[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220225150315.GO3965@kadam>
Date: Fri, 25 Feb 2022 18:03:15 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Jia-Ju Bai <baijiaju1990@...il.com>
Cc: jerome.pouiller@...abs.com, gregkh@...uxfoundation.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: wfx: correct error handling code in
wfx_init_common()
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
Powered by blists - more mailing lists