Re: [patch] reset: NULL deref on allocation failure

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

 



Hi Dan,

Am Mittwoch, den 03.04.2013, 08:02 +0300 schrieb Dan Carpenter:
> "rstc" is NULL here and we should use "rcdev" instead of "rstc->rcdev".
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index a258277..d1b6089 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -181,7 +181,7 @@ struct reset_control *reset_control_get(struct device *dev, const char *id)
>  
>  	rstc = kzalloc(sizeof(*rstc), GFP_KERNEL);
>  	if (!rstc) {
> -		module_put(rstc->rcdev->owner);
> +		module_put(rcdev->owner);
>  		return ERR_PTR(-ENOMEM);
>  	}

Acked-by: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>

thanks
Philipp

--
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