From: Manivannan Sadhasivam <mani@kernel.org>
To: Daniele Palmas <dnlplm@gmail.com>
Cc: Loic Poulain <loic.poulain@linaro.org>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/1] drivers: net: mhi: fix error path in mhi_net_newlink
Date: Mon, 4 Oct 2021 17:56:12 +0530 [thread overview]
Message-ID: <20211004122612.GF16442@workstation> (raw)
In-Reply-To: <20211004114601.13870-1-dnlplm@gmail.com>
On Mon, Oct 04, 2021 at 01:46:01PM +0200, Daniele Palmas wrote:
> Fix double free_netdev when mhi_prepare_for_transfer fails.
>
> This is a back-port of upstream:
> commit 4526fe74c3c509 ("drivers: net: mhi: fix error path in mhi_net_newlink")
>
> Fixes: 13adac032982 ("net: mhi_net: Register wwan_ops for link creation")
> Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>
Thanks,
Mani
> ---
> Hello Greg,
>
> if maintainers ack, this should go just to 5.14 branch.
>
> Thanks,
> Daniele
> ---
> drivers/net/mhi/net.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/mhi/net.c b/drivers/net/mhi/net.c
> index e60e38c1f09d..5e49f7a919b6 100644
> --- a/drivers/net/mhi/net.c
> +++ b/drivers/net/mhi/net.c
> @@ -337,7 +337,7 @@ static int mhi_net_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
> /* Start MHI channels */
> err = mhi_prepare_for_transfer(mhi_dev);
> if (err)
> - goto out_err;
> + return err;
>
> /* Number of transfer descriptors determines size of the queue */
> mhi_netdev->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE);
> @@ -347,7 +347,7 @@ static int mhi_net_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
> else
> err = register_netdev(ndev);
> if (err)
> - goto out_err;
> + return err;
>
> if (mhi_netdev->proto) {
> err = mhi_netdev->proto->init(mhi_netdev);
> @@ -359,8 +359,6 @@ static int mhi_net_newlink(void *ctxt, struct net_device *ndev, u32 if_id,
>
> out_err_proto:
> unregister_netdevice(ndev);
> -out_err:
> - free_netdev(ndev);
> return err;
> }
>
> --
> 2.30.2
>
next prev parent reply other threads:[~2021-10-04 12:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-04 11:46 [PATCH 1/1] drivers: net: mhi: fix error path in mhi_net_newlink Daniele Palmas
2021-10-04 12:19 ` Greg Kroah-Hartman
2021-10-04 12:26 ` Manivannan Sadhasivam [this message]
2021-10-06 9:08 ` Sergey Ryazanov
-- strict thread matches above, loose matches on Subject: below --
2021-09-24 9:26 Daniele Palmas
2021-09-24 9:49 ` Manivannan Sadhasivam
2021-09-24 11:11 ` Daniele Palmas
2021-09-24 9:50 ` Loic Poulain
2021-09-24 13:30 ` patchwork-bot+netdevbpf
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=20211004122612.GF16442@workstation \
--to=mani@kernel.org \
--cc=davem@davemloft.net \
--cc=dnlplm@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=loic.poulain@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=ryazanov.s.a@gmail.com \
--cc=stable@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).