drivers/base/cpu: remove redundant assignment of variable retval
authorColin Ian King <colin.king@canonical.com>
Thu, 18 Feb 2021 20:28:37 +0000 (20:28 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 23 Mar 2021 13:56:50 +0000 (14:56 +0100)
commit6b72cf128282a4c2191fc2278ba5010c85b51fb6
treeada29bc90f13b1c0bc3c3f949621db8f89ffc11d
parent2c137388d685e11cf621b56bf06c4f3a1a8ff7be
drivers/base/cpu: remove redundant assignment of variable retval

The variable retval is being initialized with a value that is never read
and it is being updated later with a new value.  Clean this up by
initializing retval to -ENOMEM and remove the assignment to retval
on the !dev failure path.

Kudos to Rafael for the improved fix suggestion.

Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210218202837.516231-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/cpu.c