lkml.org 
[lkml]   [2018]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH][next] staging: ks7010: fix null pointer dereference on priv on error exit
Date
From: Colin Ian King <colin.king@canonical.com>

In the case where the call to dev_alloc_name fails the current exit
path is via err_free_netdev and this calls free_netdev on a null priv
pointer, hence causing a null pointer dereference. Fix this by instead
exiting via err_release_irq.

Detected by CoverityScan, CID#1467844 ("Explitic null dereferenced")

Fixes: 13a9930d15b4 ("staging: ks7010: add driver from Nanonote extra-repository")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/staging/ks7010/ks7010_sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index b8f55a11ee1c..cb0e11d79e32 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -895,7 +895,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
netdev_err(priv->net_dev,
"ks7010: firmware load failed !! return code = %d\n",
ret);
- goto err_free_netdev;
+ goto err_release_irq;
}

/* interrupt setting */
--
2.17.0
\
 
 \ /
  Last update: 2018-04-12 16:58    [W:0.056 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site