Messages in this thread |  | | Subject | Re: [PATCH] fore200e: Fix incorrect checks of NULL pointer dereference | From | Markus Elfring <> | Date | Mon, 16 Dec 2019 09:43:43 +0100 |
| |
> 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
|  |