Commit d0a11693967295772d2a7c22b6b37eb20684e709
Committed by
Samuel Ortiz
1 parent
a2cddb6e41
Exists in
master
and in
7 other branches
mfd: Fix incorrect kfree(i2c) in wm8994-core i2c_driver probe
The i2c_client received in probe() should not be kfree()'d. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Showing 1 changed file with 1 additions and 3 deletions Side-by-side Diff
drivers/mfd/wm8994-core.c
... | ... | @@ -497,10 +497,8 @@ |
497 | 497 | struct wm8994 *wm8994; |
498 | 498 | |
499 | 499 | wm8994 = kzalloc(sizeof(struct wm8994), GFP_KERNEL); |
500 | - if (wm8994 == NULL) { | |
501 | - kfree(i2c); | |
500 | + if (wm8994 == NULL) | |
502 | 501 | return -ENOMEM; |
503 | - } | |
504 | 502 | |
505 | 503 | i2c_set_clientdata(i2c, wm8994); |
506 | 504 | wm8994->dev = &i2c->dev; |