[PATCH 1/1] twl4030-madc: Fix arbitrarily initialized function pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



req is an automatic variable and thus we cannot rely on it being initialized to
zero (I am leaving the 0!= NULL discussion aside). Other functions test
if this pointer is NULL, in order to determine whether it is a valid address or
not.

Signed-off-by: Viktor Rosendahl <viktor.rosendahl@xxxxxxxxx>
---
 drivers/i2c/chips/twl4030-madc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/chips/twl4030-madc.c b/drivers/i2c/chips/twl4030-madc.c
index 72b126b..743db74 100644
--- a/drivers/i2c/chips/twl4030-madc.c
+++ b/drivers/i2c/chips/twl4030-madc.c
@@ -367,6 +367,7 @@ static int twl4030_madc_ioctl(struct inode *inode, struct file *filp,
 		req.channels = (1<<par.channel);
 		req.do_avg	= par.average;
 		req.method	= TWL4030_MADC_SW1;
+		req.func_cb	= NULL;
 
 		val = twl4030_madc_conversion(&req);
 		if (val <= 0) {
-- 
1.5.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux