Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1462841 > unrolled thread

[PATCH] staging: ks7010: don't print skb->dev->name if skb is null

Started byColin King <colin.king@canonical.com>
First post2016-08-15 16:50 +0200
Last post2016-08-15 16:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: ks7010: don't print skb->dev->name if skb is null Colin King <colin.king@canonical.com> - 2016-08-15 16:50 +0200

#1462841 — [PATCH] staging: ks7010: don't print skb->dev->name if skb is null

FromColin King <colin.king@canonical.com>
Date2016-08-15 16:50 +0200
Subject[PATCH] staging: ks7010: don't print skb->dev->name if skb is null
Message-ID<s6rnb-6Or-9@gated-at.bofh.it>
From: Colin Ian King <colin.king@canonical.com>

A null pointer dereference will occur when skb is null and
skb->dev->name is printed.  Replace the skb->dev->name with
plain text "ks_wlan" to fix this.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/ks7010/ks_hostif.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index a8822fe..e8a2564 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -481,8 +481,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
 			netif_rx(skb);
 		} else {
 			printk(KERN_WARNING
-			       "%s: Memory squeeze, dropping packet.\n",
-			       skb->dev->name);
+			       "ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
@@ -517,8 +516,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
 			netif_rx(skb);
 		} else {
 			printk(KERN_WARNING
-			       "%s: Memory squeeze, dropping packet.\n",
-			       skb->dev->name);
+			       "ks_wlan: Memory squeeze, dropping packet.\n");
 			priv->nstats.rx_dropped++;
 		}
 		break;
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web