From: Dan Carpenter <dan.carpenter@oracle.com>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: jerome.pouiller@silabs.com, gregkh@linuxfoundation.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: wfx: correct error handling code in wfx_init_common()
Date: Fri, 25 Feb 2022 18:03:15 +0300 [thread overview]
Message-ID: <20220225150315.GO3965@kadam> (raw)
In-Reply-To: <20220225133409.28109-1-baijiaju1990@gmail.com>
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
prev parent reply other threads:[~2022-02-25 15:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-25 13:34 [PATCH] staging: wfx: correct error handling code in wfx_init_common() Jia-Ju Bai
2022-02-25 15:03 ` Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220225150315.GO3965@kadam \
--to=dan.carpenter@oracle.com \
--cc=baijiaju1990@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jerome.pouiller@silabs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox