From: Christian Engelmayer <cengelma@gmx.at>
To: devel@driverdev.osuosl.org
Cc: gregkh@linuxfoundation.org, Larry.Finger@lwfinger.net,
navin.patidar@gmail.com, Jes.Sorensen@redhat.com,
linux-kernel@vger.kernel.org,
Christian Engelmayer <cengelma@gmx.at>
Subject: [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar in rtw_drv_init()
Date: Sat, 17 May 2014 12:38:57 +0200 [thread overview]
Message-ID: <1400323138-32243-2-git-send-email-cengelma@gmx.at> (raw)
In-Reply-To: <1400323138-32243-1-git-send-email-cengelma@gmx.at>
Function rtw_drv_init() is written in a way that assumes 'status' != _SUCCESS
as long as not explicitly set. Thus initialize 'status' to FAIL, in order to
prevent undefined behaviour if going through the exit paths. Detected by
Coverity - CID 1077832.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 8ed2ac8..632a5b0a 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -685,7 +685,7 @@ static void rtw_usb_if1_deinit(struct adapter *if1)
static int rtw_drv_init(struct usb_interface *pusb_intf, const struct usb_device_id *pdid)
{
struct adapter *if1 = NULL;
- int status;
+ int status = _FAIL;
struct dvobj_priv *dvobj;
RT_TRACE(_module_hci_intfs_c_, _drv_err_, ("+rtw_drv_init\n"));
--
1.9.1
next prev parent reply other threads:[~2014-05-17 10:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-17 10:38 [PATCH 0/2] staging: rtl8188eu: fix Coverity defects " Christian Engelmayer
2014-05-17 10:38 ` Christian Engelmayer [this message]
2014-05-17 14:44 ` [PATCH 1/2] staging: rtl8188eu: fix usage of uninit scalar " Dan Carpenter
2014-05-17 18:56 ` Christian Engelmayer
2014-05-17 19:24 ` Dan Carpenter
2014-05-17 10:38 ` [PATCH 2/2] staging: rtl8188eu: remove dead code " Christian Engelmayer
2014-05-17 11:36 ` [PATCH 0/2] staging: rtl8188eu: fix Coverity defects " Jes Sorensen
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=1400323138-32243-2-git-send-email-cengelma@gmx.at \
--to=cengelma@gmx.at \
--cc=Jes.Sorensen@redhat.com \
--cc=Larry.Finger@lwfinger.net \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=navin.patidar@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
all inboxes | Powered by JetHome®