Re: [PATCH] staging: wfx: correct error handling code in wfx_init_common()

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

 



Thanks, but someone already fixed part of this in linux-next and I think
they sent the patch for the rest, but it just hasn't been applied yet.

> @@ -337,8 +343,10 @@ struct wfx_dev *wfx_init_common(struct device *dev,
>  	wfx_init_hif_cmd(&wdev->hif_cmd);
>  	wdev->force_ps_timeout = -1;
>  
> -	if (devm_add_action_or_reset(dev, wfx_free_common, wdev))
> +	if (devm_add_action_or_reset(dev, wfx_free_common, wdev)) {
> +		ieee80211_free_hw(hw);

This introduces a double free.  The devm_add_action_or_reset() will call
wfx_free_common() on failure.

>  		return NULL;
> +	}
>  
>  	return wdev;

regards,
dan carpenter




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux