net : null check after pointer dereference
PATCH 1/1 net : null check after pointer dereference
Author: Vishwas Srivastava <[email protected]> Date: Tue Jan 26 12:46:42 2016 +0530
null check after pointer dereference
NULL check is made after the pointer dereference is davinci- emac driver. This patch fixes this issue.
CC: Sergey Kubushyn <[email protected]>;Joe Hershberger <
[email protected]>
drivers/net/davinci_emac.c +0 -0
@@ -692,8 +692,10 @@ static int davinci_eth_rcv_packet (struct eth_device
*dev)
davinci_invalidate_rx_descs();
rx_curr_desc = emac_rx_active_head;
+ if (!rx_curr_desc)
+ return 0;
status = rx_curr_desc->pkt_flag_len;
- if ((rx_curr_desc) && ((status & EMAC_CPPI_OWNERSHIP_BIT) == 0)) {
+ if ((status & EMAC_CPPI_OWNERSHIP_BIT) == 0) {
if (status & EMAC_CPPI_RX_ERROR_FRAME) {
/* Error in packet - discard it and requeue desc */
printf ("WARN: emac_rcv_pkt: Error in packet\n");PATCH 1/1 net : null check after pointer dereference
drivers/net/davinci_emac.c
Quoted 14 lines · Vishwas Srivastava
Author: Vishwas Srivastava <[email protected]> Date: Tue Jan 26 12:46:42 2016 +0530null check after pointer dereference
NULL check is made after the pointer dereference is davinci- emac driver. This patch fixes this issue.
CC: Sergey Kubushyn <[email protected]>;Joe Hershberger <
joe.hershberger at ni.com>Signed-off-by Vishwas Srivastava <[email protected]>drivers/net/davinci_emac.c +0
-0
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160126/09e4593c/attachment.sig>
PATCH 1/1 net : null check after pointer dereference
In reply to Vishwas SrivastavaQuoted 11 lines · Vishwas Srivastava
Author: Vishwas Srivastava <[email protected]> Date: Tue Jan 26 12:46:42 2016 +0530null check after pointer dereference
NULL check is made after the pointer dereference is davinci- emac driver. This patch fixes this issue.
CC: Sergey Kubushyn <[email protected]>;Joe Hershberger <
joe.hershberger at ni.com>Signed-off-by Vishwas Srivastava <[email protected]>
PATCH 1/1 net : null check after pointer dereference
In reply to Vishwas SrivastavaQuoted 2 lines · Vishwas Srivastava
Author: Vishwas Srivastava <[email protected]> Date: Tue Jan 26 12:46:42 2016 +0530
Please fix the subject of this patch. No space in the "net :".
Quoted 2 lines
null check after pointer dereference
All of your commit logs should not have spaces in them (at the start of lines).
Quoted 6 lines
NULL check is made after the pointer dereference is davinci- emac driver. This patch fixes this issue.
CC: Sergey Kubushyn <[email protected]>;Joe Hershberger <
joe.hershberger at ni.com>
Fix this format. One "Cc:" per line.
Quoted 1 line
Signed-off-by Vishwas Srivastava <[email protected]>
This belongs first... before the Cc:
drivers/net/davinci_emac.c static int davinci_eth_rcv_packet (struct eth_device · line 695
Quoted 10 lines
drivers/net/davinci_emac.c +0
-0@@ -692,8 +692,10 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)davinci_invalidate_rx_descs (); rx_curr_desc = emac_rx_active_head;
You need to run your patches through scripts/checkpatch.pl.
Quoted 8 lines
drivers/net/davinci_emac.c +3
-1+if (!rx_curr_desc) +return 0 ; status = rx_curr_desc->pkt_flag_len; -if ((rx_curr_desc) && ((status &EMAC_CPPI_OWNERSHIP_BIT ) ==0 )) { +if ((status &EMAC_CPPI_OWNERSHIP_BIT ) ==0 ) {if (status &EMAC_CPPI_RX_ERROR_FRAME ) {/* Error in packet - discard it and requeue desc */ printf ("WARN: emac_rcv_pkt: Error in packet\n");
Consider using tools/patman.
Thanks,
-Joe