mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Aditya Pakki <pakki001@umn.edu>,
	linux-atm-general@lists.sourceforge.net, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Chas Williams <3chas3@gmail.com>, Kangjie Lu <kjlu@umn.edu>
Subject: Re: [PATCH] fore200e: Fix incorrect checks of NULL pointer dereference
Date: Mon, 16 Dec 2019 09:43:43 +0100	[thread overview]
Message-ID: <47757327-f6df-9146-03a1-2b32b23a37e6@web.de> (raw)
In-Reply-To: <20191215161451.24221-1-pakki001@umn.edu>

> The patch fixes these issues by avoiding NULL pointer dereferences.

I suggest to choose a better wording for this change description.

Will the tag “Fixes” become helpful here?


…
> +++ b/drivers/atm/fore200e.c
…
> @@ -1480,9 +1482,18 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb)
…
> +    fore200e = FORE200E_DEV(vcc->dev);
> +    fore200e_vcc = FORE200E_VCC(vcc);
> +
> +    if (!fore200e)
> +        return -EINVAL;
> +
> +    txq = &fore200e->host_txq;
> +    if (!fore200e_vcc)
> +        return -EINVAL;
>
>      if (!test_bit(ATM_VF_READY, &vcc->flags)) {
…


Can the following adjustment be nicer?

+    fore200e_vcc = FORE200E_VCC(vcc);
+    if (!fore200e_vcc)
+        return -EINVAL;
+
+    fore200e = FORE200E_DEV(vcc->dev);
+    if (!fore200e)
+        return -EINVAL;
+
+    txq = &fore200e->host_txq;


Regards,
Markus

  reply	other threads:[~2019-12-16  8:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-15 16:14 Aditya Pakki
2019-12-16  8:43 ` Markus Elfring [this message]
2019-12-17  0:28 ` David Miller

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=47757327-f6df-9146-03a1-2b32b23a37e6@web.de \
    --to=markus.elfring@web.de \
    --cc=3chas3@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-atm-general@lists.sourceforge.net \
    --cc=linux-kernel@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®