Re: [PATCH] fore200e: Fix incorrect checks of NULL pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux