* [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
@ 2015-01-26 15:39 Kumar Amit Mehta
2015-01-26 15:59 ` Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Amit Mehta @ 2015-01-26 15:39 UTC (permalink / raw)
To: gregkh
Cc: navin.patidar, Larry.Finger, dan.carpenter, tapaswenipathak,
abelmoyo.ab, devel, kernel-janitors, linux-kernel
In rtw_check_bcn_info(), check the return value of kzalloc() before
dereferencing it, to avoid NULL pointer dereference.
Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
index 3e9b6e9..a3ffc69 100644
--- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
@@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
}
bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
+ if (!bssid)
+ return _FAIL;
subtype = GetFrameSubType(pframe) >> 4;
--
2.1.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
2015-01-26 15:39 [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference Kumar Amit Mehta
@ 2015-01-26 15:59 ` Julia Lawall
2015-01-26 16:06 ` Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2015-01-26 15:59 UTC (permalink / raw)
To: Kumar Amit Mehta
Cc: gregkh, navin.patidar, Larry.Finger, dan.carpenter,
tapaswenipathak, abelmoyo.ab, devel, kernel-janitors,
linux-kernel
On Mon, 26 Jan 2015, Kumar Amit Mehta wrote:
> In rtw_check_bcn_info(), check the return value of kzalloc() before
> dereferencing it, to avoid NULL pointer dereference.
>
> Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
> ---
> drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> index 3e9b6e9..a3ffc69 100644
> --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> @@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
> }
>
> bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
> + if (!bssid)
> + return _FAIL;
I haven't looked at this issue in a while, but shouldn't this be
OBD_ALLOC?
Although I still find macros parameters that are side effected to be
unpleasant...
julia
> subtype = GetFrameSubType(pframe) >> 4;
>
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference
2015-01-26 15:59 ` Julia Lawall
@ 2015-01-26 16:06 ` Julia Lawall
0 siblings, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2015-01-26 16:06 UTC (permalink / raw)
To: Julia Lawall
Cc: Kumar Amit Mehta, gregkh, navin.patidar, Larry.Finger,
dan.carpenter, tapaswenipathak, abelmoyo.ab, devel,
kernel-janitors, linux-kernel
On Mon, 26 Jan 2015, Julia Lawall wrote:
> On Mon, 26 Jan 2015, Kumar Amit Mehta wrote:
>
> > In rtw_check_bcn_info(), check the return value of kzalloc() before
> > dereferencing it, to avoid NULL pointer dereference.
> >
> > Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
> > ---
> > drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> > index 3e9b6e9..a3ffc69 100644
> > --- a/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> > +++ b/drivers/staging/rtl8188eu/core/rtw_wlan_util.c
> > @@ -931,6 +931,8 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
> > }
> >
> > bssid = kzalloc(sizeof(struct wlan_bssid_ex), GFP_ATOMIC);
> > + if (!bssid)
> > + return _FAIL;
>
> I haven't looked at this issue in a while, but shouldn't this be
> OBD_ALLOC?
Sorry for the noise. I assumed that both patches were for lustre, but
this one is not.
julia
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-26 16:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 15:39 [PATCH] staging: rtl8188eu: core: rtw_wlan_util.c: Fix for NULL dereference Kumar Amit Mehta
2015-01-26 15:59 ` Julia Lawall
2015-01-26 16:06 ` Julia Lawall
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®