Skip to content

Commit

Permalink
mfd/asic3: fix asic3_mfd_probe return value
Browse files Browse the repository at this point in the history
In commit 4f30424 "mfd: Set asic3 DS1WM clock_rate", a possible
path through asic3_mfd_probe was introduced that would lead to
an unpredictable return value, if everything succeeds but there
are pdata->leds is NULL. This was reported correctly by gcc.

Without this patch, building magician_defconfig results in:

drivers/mfd/asic3.c: In function 'asic3_mfd_probe':
drivers/mfd/asic3.c:940:2: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Arnd Bergmann committed Aug 8, 2012
1 parent 0d7614f commit b2f0fa8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/mfd/asic3.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ static int __init asic3_mfd_probe(struct platform_device *pdev,
goto out;
}

ret = 0;
if (pdata->leds) {
int i;

Expand Down

0 comments on commit b2f0fa8

Please sign in to comment.