[kernel/f13/master] lirc_imon: move alloc before use (#629980)

Kyle McMartin kyle at fedoraproject.org
Fri Sep 3 15:49:20 UTC 2010


commit 38c97e08f74990dcf7c9b06ff3ae9d47e1f99552
Author: Kyle McMartin <kyle at dreadnought.i.jkkm.org>
Date:   Fri Sep 3 11:49:09 2010 -0400

    lirc_imon: move alloc before use (#629980)

 kernel.spec       |    3 +++
 lirc-2.6.33.patch |   15 ++++++++-------
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 35aba9d..7e151a1 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -2060,6 +2060,9 @@ fi
 
 
 %changelog
+* Fri Sep 03 2010 Kyle McMartin <kmcmartin at redhat.com>
+- lirc_imon: move alloc before use (rhbz#629980)
+
 * Fri Sep 03 2010 Chuck Ebbert <cebbert at redhat.com>  2.6.34.6-50
 - Re-enable I2O, but only for 32-bit x86 (#629676)
 - Add support for eject key on Dell laptops (#513530)
diff --git a/lirc-2.6.33.patch b/lirc-2.6.33.patch
index aa6d4b6..70e3016 100644
--- a/lirc-2.6.33.patch
+++ b/lirc-2.6.33.patch
@@ -3598,7 +3598,7 @@ new file mode 100644
 index 0000000..5bea43b
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_imon.c
-@@ -0,0 +1,1054 @@
+@@ -0,0 +1,1055 @@
 +/*
 + *   lirc_imon.c:  LIRC/VFD/LCD driver for SoundGraph iMON IR/VFD/LCD
 + *		   including the iMON PAD model
@@ -4331,6 +4331,13 @@ index 0000000..5bea43b
 +	int i;
 +	u16 vendor, product;
 +
++	context = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
++	if (!context) {
++		err("%s: kzalloc failed for context", __func__);
++		alloc_status = 1;
++		goto alloc_status_switch;
++	}
++
 +	/*
 +	 * Try to auto-detect the type of display if the user hasn't set
 +	 * it by hand via the display_type modparam. Default is VFD.
@@ -4413,12 +4420,6 @@ index 0000000..5bea43b
 +			__func__, vfd_proto_6p);
 +	}
 +
-+	context = kzalloc(sizeof(struct imon_context), GFP_KERNEL);
-+	if (!context) {
-+		err("%s: kzalloc failed for context", __func__);
-+		alloc_status = 1;
-+		goto alloc_status_switch;
-+	}
 +	driver = kzalloc(sizeof(struct lirc_driver), GFP_KERNEL);
 +	if (!driver) {
 +		err("%s: kzalloc failed for lirc_driver", __func__);


More information about the scm-commits mailing list