Skip to contentSkip to conversation

Checks for Null value in function *get_skub

PATCH Superseded Nicholas Krause 2 participants 2 messages Jun 16, 2014

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Checks for Null value in function *get_skub

---
 drivers/infiniband/hw/cxgb4/cm.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +2 -0
index f9477e2..2d56983 100644
@@ -340,15 +340,13 @@ static int status2errno(int status)
  */
 static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp)
 {
 if (skb && !skb_is_nonlinear(skb) && !skb_cloned(skb)) {
                skb_trim(skb, 0);
                skb_get(skb);
                skb_reset_transport_header(skb);
 	} else {
+		if (!skb)
+			kfree(skb);
 		skb = alloc_skb(len, gfp);
 	}
 	t4_set_arp_err_handler(skb, NULL, NULL);
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw
Quoted 13 lines · Nicholas Krause
---
  drivers/infiniband/hw/cxgb4/cm.c | 8 +++-----
  1 file changed, 3 insertions(+), 5 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +0 -0
index f9477e2..2d56983 100644
@@ -340,15 +340,13 @@ static int status2errno(int status)
   */
  static struct sk_buff *get_skb(struct sk_buff *skb, int len, gfp_t gfp)
  {

drivers/infiniband/hw/cxgb4/cm.c static int status2errno(int status) · line 352

Quoted 10 lines
drivers/infiniband/hw/cxgb4/cm.c +2 -0
  if (skb && !skb_is_nonlinear(skb) && !skb_cloned(skb)) {
                 skb_trim(skb, 0);
                 skb_get(skb);
                 skb_reset_transport_header(skb);
  	} else {
+		if (!skb)
+			kfree(skb);
  		skb = alloc_skb(len, gfp);
  	}
  	t4_set_arp_err_handler(skb, NULL, NULL);

Should be 'if (skb)'

:)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html