]> asedeno.scripts.mit.edu Git - linux.git/commit
hwmon: (xgene) Fix up error handling path mixup in 'xgene_hwmon_probe()'
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sat, 23 Sep 2017 06:44:15 +0000 (08:44 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 1 Oct 2017 15:46:54 +0000 (08:46 -0700)
commit74007ae6316ebe40260e44f8ab558f9b1ccc04e5
tree4d5b01ecdd6263d930608d98037e7d5146a6b628
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e
hwmon: (xgene) Fix up error handling path mixup in 'xgene_hwmon_probe()'

Commit 2ca492e22cb7 has moved the call to 'kfifo_alloc()' from after the
main 'if' statement to before it.
But it has not updated the error handling paths accordingly.

Fix all that:
   - if 'kfifo_alloc()' fails we can return directly
   - direct returns after 'kfifo_alloc()' must now go to 'out_mbox_free'
   - 'goto out_mbox_free' must be replaced by 'goto out', otherwise the
     '[pcc_]mbox_free_channel()' call will be missed.

Fixes: 2ca492e22cb7 ("hwmon: (xgene) Fix crash when alarm occurs before driver probe")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/xgene-hwmon.c