Prev: [PATCH] [ARM] .gitignore: Ignore piggy.lzo, lib1funcs.S and vmlinux
Next: i915_do_wait_request BUG: unable to handle kernel NULL pointer dereference at (null)
From: axel.lin on 23 Apr 2010 06:20 1. It is not necessary to free priv if kzalloc fail. 2. priv should be freed if gpio_request for pdata->reset_gpio and pdata->data_enable_gpio fail. Signed-off-by: Axel Lin <axel.lin(a)gmail.com> Cc: Richard Purdie <rpurdie(a)linux.intel.com> --- drivers/video/backlight/l4f00242t03.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index bcdb12c..05d32e3 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c @@ -126,7 +126,7 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) if (priv == NULL) { dev_err(&spi->dev, "No memory for this device.\n"); ret = -ENOMEM; - goto err; + return ret; } dev_set_drvdata(&spi->dev, priv); @@ -139,7 +139,7 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 reset gpio.\n"); - return ret; + goto err; } ret = gpio_direction_output(pdata->reset_gpio, 1); @@ -151,7 +151,7 @@ static int __devinit l4f00242t03_probe(struct spi_device *spi) if (ret) { dev_err(&spi->dev, "Unable to get the lcd l4f00242t03 data en gpio.\n"); - return ret; + goto err2; } ret = gpio_direction_output(pdata->data_enable_gpio, 0); -- 1.5.4.3 |