mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ursula Braun <ubraun@linux.ibm.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Karsten Graul <kgraul@linux.ibm.com>,
	"David S. Miller" <davem@davemloft.net>,
	linux-s390@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: smc: fix a NULL pointer dereference
Date: Fri, 15 Mar 2019 11:18:24 +0100	[thread overview]
Message-ID: <9887da6d-fc29-eedb-e172-a28edc3d1c4d@linux.ibm.com> (raw)
In-Reply-To: <20190315041555.1801-1-kjlu@umn.edu>



On 3/15/19 5:15 AM, Kangjie Lu wrote:
> In case alloc_ordered_workqueue fails, the fix returns NULL
> to avoid NULL pointer dereference.
> 

Thanks, looks good. Your patch will be part of our next patch
submission for the net-tree.

Regards, Ursula

> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  net/smc/smc_ism.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/net/smc/smc_ism.c b/net/smc/smc_ism.c
> index 2fff79db1a59..e89e918b88e0 100644
> --- a/net/smc/smc_ism.c
> +++ b/net/smc/smc_ism.c
> @@ -289,6 +289,11 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,
>  	INIT_LIST_HEAD(&smcd->vlan);
>  	smcd->event_wq = alloc_ordered_workqueue("ism_evt_wq-%s)",
>  						 WQ_MEM_RECLAIM, name);
> +	if (!smcd->event_wq) {
> +		kfree(smcd->conn);
> +		kfree(smcd);
> +		return NULL;
> +	}
>  	return smcd;
>  }
>  EXPORT_SYMBOL_GPL(smcd_alloc_dev);
> 


      reply	other threads:[~2019-03-15 10:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-15  4:15 Kangjie Lu
2019-03-15 10:18 ` Ursula Braun [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=9887da6d-fc29-eedb-e172-a28edc3d1c4d@linux.ibm.com \
    --to=ubraun@linux.ibm.com \
    --cc=davem@davemloft.net \
    --cc=kgraul@linux.ibm.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    /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

all inboxes | Powered by JetHome®