From: Colin King <colin.king@canonical.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Tobin C . Harding" <me@tobin.cc>,
Sergio Paracuellos <sergio.paracuellos@gmail.com>,
Quytelda Kahja <quytelda@tamalin.org>,
devel@driverdev.osuosl.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH][next] staging: ks7010: fix null pointer dereference on priv on error exit
Date: Thu, 12 Apr 2018 15:57:56 +0100 [thread overview]
Message-ID: <20180412145756.24949-1-colin.king@canonical.com> (raw)
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
next reply other threads:[~2018-04-12 14:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-12 14:57 Colin King [this message]
2018-04-12 15:12 ` [PATCH][next] staging: ks7010: fix null pointer dereference on priv on error exit Dan Carpenter
2018-04-12 15:20 ` Colin Ian King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180412145756.24949-1-colin.king@canonical.com \
--to=colin.king@canonical.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@tobin.cc \
--cc=quytelda@tamalin.org \
--cc=sergio.paracuellos@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).