From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Daeseok Youn <daeseok.youn@gmail.com>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: fix NULL derefencing in fwnet_probe()
Date: Mon, 12 May 2014 14:38:18 +0200 [thread overview]
Message-ID: <20140512143818.2ae752e6@kant> (raw)
In-Reply-To: <20140429094947.GA11409@devel>
On Apr 29 Daeseok Youn wrote:
> "dev" and "net" are NULL when alloc_netdev() is failed.
> So just unlock and return an error.
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Pushed to linux1394.git. Thank you.
> ---
> drivers/firewire/net.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
> index 4af0a7b..c398645 100644
> --- a/drivers/firewire/net.c
> +++ b/drivers/firewire/net.c
> @@ -1462,8 +1462,8 @@ static int fwnet_probe(struct fw_unit *unit,
>
> net = alloc_netdev(sizeof(*dev), "firewire%d", fwnet_init_dev);
> if (net == NULL) {
> - ret = -ENOMEM;
> - goto out;
> + mutex_unlock(&fwnet_device_mutex);
> + return -ENOMEM;
> }
>
> allocated_netdev = true;
--
Stefan Richter
-=====-====- -=-= -==--
http://arcgraph.de/sr/
prev parent reply other threads:[~2014-05-12 12:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 9:49 [PATCH] firewire: fix NULL derefencing in fwnet_probe() Daeseok Youn
2014-05-12 12:38 ` Stefan Richter [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=20140512143818.2ae752e6@kant \
--to=stefanr@s5r6.in-berlin.de \
--cc=daeseok.youn@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux1394-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.