From: Connor Kuehl <connor.kuehl@canonical.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Larry.Finger@lwfinger.net, gregkh@linuxfoundation.org,
devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails
Date: Thu, 3 Oct 2019 14:05:51 -0700 [thread overview]
Message-ID: <ac882530-4197-7813-ca24-49738eebb0c8@canonical.com> (raw)
In-Reply-To: <20191001131122.GC22609@kadam>
On 10/1/19 6:11 AM, Dan Carpenter wrote:
>
> There is another one earlier in the function as well.
>
> drivers/staging/rtl8188eu/os_dep/usb_intf.c
> 336
> 337 pnetdev = rtw_init_netdev(padapter);
> 338 if (!pnetdev)
> 339 goto free_adapter;
> 340 SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
> 341 padapter = rtw_netdev_priv(pnetdev);
> 342
> 343 if (padapter->registrypriv.monitor_enable) {
> 344 pmondev = rtl88eu_mon_init();
> 345 if (!pmondev)
> 346 netdev_warn(pnetdev, "Failed to initialize monitor interface");
>
> goto free_adapter.
>
> 347 padapter->pmondev = pmondev;
> 348 }
> 349
> 350 padapter->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
> 351 if (!padapter->HalData)
> 352 DBG_88E("cant not alloc memory for HAL DATA\n");
> 353
>
>> padapter->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
>> - if (!padapter->HalData)
>> - DBG_88E("cant not alloc memory for HAL DATA\n");
>> + if (!padapter->HalData) {
>> + DBG_88E("Failed to allocate memory for HAL data\n");
>
> Remove this debug printk.
>
>> + goto free_adapter;
>> + }
Hi Dan,
Sorry for such a late response! By the time I saw the e-mail with your
feedback I also saw another e-mail saying this patch was accepted into a
staging-linus tree. I'll address your comments in a separate patch.
Thank you,
Connor
prev parent reply other threads:[~2019-10-03 21:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-27 21:44 [PATCH] staging: rtl8188eu: fix null dereference when kzalloc fails Connor Kuehl
2019-10-01 13:11 ` Dan Carpenter
2019-10-03 21:05 ` Connor Kuehl [this message]
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=ac882530-4197-7813-ca24-49738eebb0c8@canonical.com \
--to=connor.kuehl@canonical.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).