Re: [patch] hwmon/max6697: fix memset size in max6697_init_chip()

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

 



On Tue, Jan 15, 2013 at 09:53:08AM +0300, Dan Carpenter wrote:
> sizeof(p) was intended instead of sizeof(data).  data is a pointer and
> p is a 7 character struct.  It probably doesn't make a difference most
> of the time, but it could result in using uninitialized data.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
Hi Dan,

Thanks a lot!

Guenter

> diff --git a/drivers/hwmon/max6697.c b/drivers/hwmon/max6697.c
> index a1c8c0a..d229cc7 100644
> --- a/drivers/hwmon/max6697.c
> +++ b/drivers/hwmon/max6697.c
> @@ -474,7 +474,7 @@ static int max6697_init_chip(struct i2c_client *client)
>  		return 0;
>  
>  	if (!pdata || client->dev.of_node) {
> -		memset(&p, 0, sizeof(data));
> +		memset(&p, 0, sizeof(p));
>  		max6697_get_config_of(client->dev.of_node, &p);
>  		pdata = &p;
>  	}
> 
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux