staging: ks7010: fix null pointer dereference on priv on error exit
Subsystems (2)
PATCH 1/1 staging: ks7010: fix null pointer dereference on priv on error exit
From: Colin Ian King <[email protected]>
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")
--- drivers/staging/ks7010/ks7010_sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/ks7010/ks7010_sdio.c +1 -1
@@ -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 */
Signature · 1 line
2.17.0
This isn't right. It introduces a leak.
regards,
dan carpenter
Quoted 1 line · Dan Carpenter
This isn't right. It introduces a leak.
Yup, and I see Gustavo is working on a correct fix, I'll leave that to him.
Quoted 9 lines
regards,
dan carpenter--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html