]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
twl4030-madc: Fix arbitrarily initialized function pointer
authorViktor Rosendahl <viktor.rosendahl@nokia.com>
Wed, 2 Jul 2008 13:36:36 +0000 (16:36 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 4 Aug 2008 14:31:26 +0000 (17:31 +0300)
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@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/chips/twl4030-madc.c

index 72b126b7e7a6d43f9ae8ad6d78754051627395ef..743db749914e7d87efb8339391d0d1a3771d9862 100644 (file)
@@ -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) {