From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EFF96D28 for ; Thu, 15 Apr 2021 05:26:14 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13F5K4wW114359; Thu, 15 Apr 2021 05:26:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=u1HGY2pdiUJpZnVn7iUNNrPvZ0VUQmj8sncbkjdtkWI=; b=JuHbIj78j45980ej6OquW305F61Ve91x3TL1DIfMgFv0mG6VPsffq8M7HaIQ/0eRwrAM aG1ZgNXuiio8pc6GGwmPKsOuCI4BW54Urro0yavfXCp8Y1oFmKY9eDpaTtaRs0gw45Fj yhEP/OE4CzzIvNlTTxub7gcq2IdkwuirZxhQOTfcqyzsn+ipjrWpyHUt9AIjug9wP0tl B7JB7+Wnn/ishOv1IJS5Ui49yz4024/LhH6GRAPWHspyW9U7DDA89rAi6PPOTMixBeli oUY6db/Fjpz9zVljUDg7WcmbiLpr8RHoSH/evy8lW16eRMSa3Lqq3IczpY6Uk/yxr8XD yg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 37u3ermjfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Apr 2021 05:26:06 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13F5OZxu189813; Thu, 15 Apr 2021 05:26:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 37unks2ajd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Apr 2021 05:26:04 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 13F5Q4Ut017954; Thu, 15 Apr 2021 05:26:04 GMT Received: from kadam (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Apr 2021 05:26:03 +0000 Date: Thu, 15 Apr 2021 08:25:56 +0300 From: Dan Carpenter Cc: linux-kernel@vger.kernel.org, Larry Finger , Greg Kroah-Hartman , linux-staging@lists.linux.dev Subject: Re: [PATCH 37/57] staging: rtl8188eu: os_dep: ioctl_linux: Move 2 large data buffers into the heap Message-ID: <20210415052556.GZ6021@kadam> References: <20210414181129.1628598-1-lee.jones@linaro.org> <20210414181129.1628598-38-lee.jones@linaro.org> <20210415051835.GY6021@kadam> X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210415051835.GY6021@kadam> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-IMR: 1 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9954 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104150038 X-Proofpoint-ORIG-GUID: rDoebdlzTrhoDEkwAfrnVev4-GCD-9bq X-Proofpoint-GUID: rDoebdlzTrhoDEkwAfrnVev4-GCD-9bq X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9954 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104150037 On Thu, Apr 15, 2021 at 08:20:16AM +0300, Dan Carpenter wrote: > On Wed, Apr 14, 2021 at 07:11:09PM +0100, Lee Jones wrote: > > --- > > drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > index c95ae4d6a3b6b..cc14f00947781 100644 > > --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > @@ -224,7 +224,7 @@ static char *translate_scan(struct adapter *padapter, > > /* parsing WPA/WPA2 IE */ > > { > > u8 *buf; > > - u8 wpa_ie[255], rsn_ie[255]; > > + u8 *wpa_ie, *rsn_ie; > > u16 wpa_len = 0, rsn_len = 0; > > u8 *p; > > > > @@ -232,6 +232,14 @@ static char *translate_scan(struct adapter *padapter, > > if (!buf) > > return start; Arnd, added this return... I don't understand why we aren't returning -ENOMEM here. > > > > + wpa_ie = kzalloc(255, GFP_ATOMIC); > > + if (!wpa_ie) > > + return start; > > kfree(buf); > > > + > > + rsn_ie = kzalloc(255, GFP_ATOMIC); > > + if (!rsn_ie) > > + return start; > regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 626EDC433B4 for ; Thu, 15 Apr 2021 05:26:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DC316115C for ; Thu, 15 Apr 2021 05:26:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230055AbhDOF0l (ORCPT ); Thu, 15 Apr 2021 01:26:41 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:35494 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhDOF0j (ORCPT ); Thu, 15 Apr 2021 01:26:39 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13F5K4wW114359; Thu, 15 Apr 2021 05:26:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=u1HGY2pdiUJpZnVn7iUNNrPvZ0VUQmj8sncbkjdtkWI=; b=JuHbIj78j45980ej6OquW305F61Ve91x3TL1DIfMgFv0mG6VPsffq8M7HaIQ/0eRwrAM aG1ZgNXuiio8pc6GGwmPKsOuCI4BW54Urro0yavfXCp8Y1oFmKY9eDpaTtaRs0gw45Fj yhEP/OE4CzzIvNlTTxub7gcq2IdkwuirZxhQOTfcqyzsn+ipjrWpyHUt9AIjug9wP0tl B7JB7+Wnn/ishOv1IJS5Ui49yz4024/LhH6GRAPWHspyW9U7DDA89rAi6PPOTMixBeli oUY6db/Fjpz9zVljUDg7WcmbiLpr8RHoSH/evy8lW16eRMSa3Lqq3IczpY6Uk/yxr8XD yg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 37u3ermjfa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Apr 2021 05:26:06 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13F5OZxu189813; Thu, 15 Apr 2021 05:26:04 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 37unks2ajd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Apr 2021 05:26:04 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 13F5Q4Ut017954; Thu, 15 Apr 2021 05:26:04 GMT Received: from kadam (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Apr 2021 05:26:03 +0000 Date: Thu, 15 Apr 2021 08:25:56 +0300 From: Dan Carpenter Cc: linux-kernel@vger.kernel.org, Larry Finger , Greg Kroah-Hartman , linux-staging@lists.linux.dev Subject: Re: [PATCH 37/57] staging: rtl8188eu: os_dep: ioctl_linux: Move 2 large data buffers into the heap Message-ID: <20210415052556.GZ6021@kadam> References: <20210414181129.1628598-1-lee.jones@linaro.org> <20210414181129.1628598-38-lee.jones@linaro.org> <20210415051835.GY6021@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210415051835.GY6021@kadam> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-IMR: 1 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9954 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 mlxscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104150038 X-Proofpoint-ORIG-GUID: rDoebdlzTrhoDEkwAfrnVev4-GCD-9bq X-Proofpoint-GUID: rDoebdlzTrhoDEkwAfrnVev4-GCD-9bq X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9954 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxlogscore=999 bulkscore=0 malwarescore=0 spamscore=0 impostorscore=0 suspectscore=0 mlxscore=0 phishscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104150037 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 15, 2021 at 08:20:16AM +0300, Dan Carpenter wrote: > On Wed, Apr 14, 2021 at 07:11:09PM +0100, Lee Jones wrote: > > --- > > drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 12 +++++++++++- > > 1 file changed, 11 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > index c95ae4d6a3b6b..cc14f00947781 100644 > > --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c > > @@ -224,7 +224,7 @@ static char *translate_scan(struct adapter *padapter, > > /* parsing WPA/WPA2 IE */ > > { > > u8 *buf; > > - u8 wpa_ie[255], rsn_ie[255]; > > + u8 *wpa_ie, *rsn_ie; > > u16 wpa_len = 0, rsn_len = 0; > > u8 *p; > > > > @@ -232,6 +232,14 @@ static char *translate_scan(struct adapter *padapter, > > if (!buf) > > return start; Arnd, added this return... I don't understand why we aren't returning -ENOMEM here. > > > > + wpa_ie = kzalloc(255, GFP_ATOMIC); > > + if (!wpa_ie) > > + return start; > > kfree(buf); > > > + > > + rsn_ie = kzalloc(255, GFP_ATOMIC); > > + if (!rsn_ie) > > + return start; > regards, dan carpenter