Skip to contentSkip to conversation

ILI9320: Ensure resource cleanup on exit.

PATCH Ben Dooks 1 participant 1 message Jun 24, 2008

Subsystems (2)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

Ensure we free our 'struct ili9320' on exit or error.

drivers/video/backlight/ili9320.c +6 -5
Index: linux-2.6.26-rc7-quilt1/drivers/video/backlight/ili9320.c
===================================================================
@@ -259,18 +259,19 @@ int __devinit ili9320_probe_spi(struct s
 	lcd_device_unregister(lcd);
 
  err_free:
-	kfree(lcd);
+	kfree(ili);
+
 	return ret;
 }
 
 EXPORT_SYMBOL_GPL(ili9320_probe_spi);
 
-int __devexit ili9320_remove(struct ili9320 *lcd)
+int __devexit ili9320_remove(struct ili9320 *ili)
 {
-	ili9320_power(lcd, FB_BLANK_POWERDOWN);
+	ili9320_power(ili, FB_BLANK_POWERDOWN);
 
-	lcd_device_unregister(lcd->lcd);
-	kfree(lcd);
+	lcd_device_unregister(ili->lcd);
+	kfree(ili);
 
 	return 0;
 }
Signature · 9 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php