diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-03-12 20:33:51 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-03-12 20:33:51 +0000 |
commit | 8688a1a8637c6b833b9b70148809db4538352d2e (patch) | |
tree | 7b5d6c2d83c8bd1686811501c6287a650c40751b /drivers/video | |
parent | 3afdb0f3528991de0833224f2dba60dc061e01fa (diff) | |
parent | f91f9cd505f92e4227ffda7e5799a33d4f34bf36 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/tglx/linux-2.6-tcc into devel-stable
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/backlight/ltv350qv.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c index 8010aaeb5ad..dd0e84a9bd2 100644 --- a/drivers/video/backlight/ltv350qv.c +++ b/drivers/video/backlight/ltv350qv.c @@ -239,11 +239,15 @@ static int __devinit ltv350qv_probe(struct spi_device *spi) lcd->spi = spi; lcd->power = FB_BLANK_POWERDOWN; lcd->buffer = kzalloc(8, GFP_KERNEL); + if (!lcd->buffer) { + ret = -ENOMEM; + goto out_free_lcd; + } ld = lcd_device_register("ltv350qv", &spi->dev, lcd, <v_ops); if (IS_ERR(ld)) { ret = PTR_ERR(ld); - goto out_free_lcd; + goto out_free_buffer; } lcd->ld = ld; @@ -257,6 +261,8 @@ static int __devinit ltv350qv_probe(struct spi_device *spi) out_unregister: lcd_device_unregister(ld); +out_free_buffer: + kfree(lcd->buffer); out_free_lcd: kfree(lcd); return ret; @@ -268,6 +274,7 @@ static int __devexit ltv350qv_remove(struct spi_device *spi) ltv350qv_power(lcd, FB_BLANK_POWERDOWN); lcd_device_unregister(lcd->ld); + kfree(lcd->buffer); kfree(lcd); return 0; |