Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp255018iob; Wed, 18 May 2022 01:14:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJBoi4UZkqJfYIey3bRG04NSNiZhwcKz9iiCF+HyJLdRIOaaqNqnhPG0XA4ASkleZ2N5Sh X-Received: by 2002:a17:902:b18e:b0:15f:b2c:6ca with SMTP id s14-20020a170902b18e00b0015f0b2c06camr26088901plr.84.1652861680158; Wed, 18 May 2022 01:14:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652861680; cv=pass; d=google.com; s=arc-20160816; b=Pzsd0n0pXatFhhQviXTHgrf8b2y7hsXuCrFYPPwq9+PVY1U+QGfYOJgozLt0+cBMhY xW+8xy1yquoWTnj3y9OcCMvBosk6RwFaLKIitCx+2Ojc/KiIHownXzTn/SC8mIlkiSFH Ef3DB77sy9HRMqoCO9+fKUgkH4BgeBvp58DTXs/2lalYwBzmFc6RMmnJjNSHHEFXmRnj DCeDmWKqZtd4vDjZPDpU8gT9Pg6Vso1vqel+0MyMBj782oiWsuJN4sxYKd2IU3kuK+Z+ ZCuTO/m7SY+SOtSRA3Zg8nqdqVCMC9Xm1zp7E6q7H3CkhQnqTn4VtcJQSrJr5Y0Tq43v X2aA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:in-reply-to :content-disposition:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=fWIlhl3xtPBE4856KhgEcJD/qAiZtdTHnUeRoEBc39A=; b=RbKQ7AdauK4KXT47SCiPFDPaafB5mEQHyPtkcgnWFgRmyiuqPl7KZFhR16RkML16fz +eYjFORuzsDoIYbTwaXPZBlmgXwe6Y7DKIxN/jgSDH2w7iwp8sqmA2E3wW8OgoB/LNEp fEyt7qhEEEqQDeWBx5feUWSfXiJi9YDL8j1joHP1EsbhVC/xITym0X4y0TgrDX3VaawK 7v4EnUF89OCgO1Jk8TLn1UVUzd1hPA7v/+uV6vhE3h7XrL6PWDPCF03ClUb6A9K/k6Gt np9aKbRRXjGS+L+JmpJuBGVZ64TnP878ObXFNj4BRB3udZ59fhM5GAzDmyWjA4lNHuZx HD0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Dce57V4S; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=m8jh1w2S; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s19-20020aa78293000000b0050cff7b2666si1968936pfm.241.2022.05.18.01.14.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:14:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=Dce57V4S; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=m8jh1w2S; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9198281994; Wed, 18 May 2022 01:14:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232753AbiERIO0 (ORCPT + 99 others); Wed, 18 May 2022 04:14:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232680AbiERIOZ (ORCPT ); Wed, 18 May 2022 04:14:25 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E65158D6BE for ; Wed, 18 May 2022 01:14:23 -0700 (PDT) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24I7RUmP023077; Wed, 18 May 2022 08:13:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=fWIlhl3xtPBE4856KhgEcJD/qAiZtdTHnUeRoEBc39A=; b=Dce57V4SY+yIfyfy6B3n639qoRFWvCZEjvR1K6miT1wj6ncB9Cbp9sPJt2IGyGvhfLgh 2Tcu5s0WXTM8RRTrr5N52omMj7MCgY4/4SlalG+3OLloXds094W9yPTyb6djY1l9jDV4 Au9fkndrKlTlCWJtVBLzZLDxr8d45XHW8qK95ObDWZaBrOynnhoSDRPWANviwDqKbga/ 76pe2MpGAzVXkjZ6/O378EvACugpoFR0mx+0SwK9VItzSfMZKYXX8uR+kXm+DZPHrZr0 qju1l+cLYGbCrs5Cw9CRARKQaUHsdzH9ekVcra2PusUkkuN8tZpzlEQw1tVpIQSre3q5 jQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3g241s8gdk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 May 2022 08:13:54 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.16.1.2/8.16.1.2) with SMTP id 24I8Bn1X006302; Wed, 18 May 2022 08:13:51 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2107.outbound.protection.outlook.com [104.47.58.107]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com with ESMTP id 3g22v44c6u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 May 2022 08:13:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L+Arwre6adfZH2Q0z7WRePkOf2Ir+Yf+n2PWle6jRrvYOqfSG3dFbFkoFFRNlzNco2zCer9P1LROfgHJfRnYcs+SIixdyEIJZx5QQ+5HE9FqXPgFKCcVB63plksET0om+XMqGfjebaRZsViLKbSVS4vwoxluHoZDx5OL1Im3zHbpn8B5C9wlKbnEdbxwvnFUurH1msH2DkAJERjqKa77IVDh+Tsj+6jaAl+ddJhgK+4vh2/hXEClf0slWSJIG5eGV9IMY566BF/DFfgq/cE5q4Fl5AFigSakRQ9xvYlO+m68lys8ycEvNZSscHhKWJjbbDY7T5d+WHiv/cZqlBL1NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fWIlhl3xtPBE4856KhgEcJD/qAiZtdTHnUeRoEBc39A=; b=VD90jO0dzZtSUqm0SILwfbGJw6omGWFf5jEr4rgmk1oyDISEzI0EvTC/Sq6V/Wl/kNFF3HhiYpzf+p5ppcTRlL8/r4kergkKVBiM1TbXxtD9yK1H7xOyjgDdFDgZXMgB7Rh++IdI4HfmwhTsCW4PBcKK9N4/fSh64svOAkDgxFtX7pHZJaGQ+gC3ImXanr/J2XB4bUxOYIYr/R3MpOc/8ALxHj3uSWCAZiNzcZ3bnIyOwnhc10CVZr3g/KKhKgz3+nNG+0Nj1Ths9h9KJjzyZUHifVpff1lRED79pzKsreu3DKnXFkWlN8wlcqWa6GpoRGlsdfa+tfs3k8q/CmmeCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fWIlhl3xtPBE4856KhgEcJD/qAiZtdTHnUeRoEBc39A=; b=m8jh1w2SB6LtGlTOkFlRPpje7X/NwexoXOnlmTIId40852TvOuoWqmixtISc9HykI9anwgHZSk0HxWrobRI8gGpEncPf7A/thpJfcLUW7hxvI0HYWwAmNj7wtQD7ChfmxTB4J0udIC47VgivtbdwGUbMqHx1UoWb+93ij+1o5/Y= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB4710.namprd10.prod.outlook.com (2603:10b6:510:3e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Wed, 18 May 2022 08:13:49 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::86f:81ba:9951:5a7e%2]) with mapi id 15.20.5273.014; Wed, 18 May 2022 08:13:49 +0000 Date: Wed, 18 May 2022 11:13:35 +0300 From: Dan Carpenter To: Jiasheng Jiang Cc: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, straube.linux@gmail.com, fmdefrancesco@gmail.com, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] staging: r8188eu: add check for kzalloc Message-ID: <20220518081335.GR4009@kadam> References: <20220518075957.514603-1-jiasheng@iscas.ac.cn> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220518075957.514603-1-jiasheng@iscas.ac.cn> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: MR2P264CA0181.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501::20) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e08536c-950e-44a6-f8bf-08da38a65689 X-MS-TrafficTypeDiagnostic: PH0PR10MB4710:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6/h4cQq/5Sv4A98pJfJbwJlc3+L5fUwbpn6OjBhgA7LUOUaB3B8E3P5QLsrC3hyvTRvTlPfrudlpaz5PFED24dzMj7T/LcEWdadPRtdkcr4bKHDbV9rtyQ4CeF2ux4ahZoqqgTrZT04cowBUzDBUhRukjiPs56TRT2utFWP8rh9WPgp8m8tDpU4unUxUenMZSs67Oa8aUjTuh95HkGs9XSogq0Y3HIlsyCrSj7CspdqBWTAOuyopvkOq0gZYFDb1IJg675mL89EGw6mO39+DmGbtZDjNOPRtZUjZ2ulrg3wD2kn2YbBzc6YVj5hz4WnrzsICS5eFkPiMP+zBblx2ahCvbjZd9AqrbFo1wICZoPDX7psx4n+O026fhq+FJojA/2IiOg12GF9cYjSv7eDcSvyOxq4lwuV4APC9ruwRhX1KyRMTc4d+pwzAikXEK6B0Be5eC/nggG2uJiQb8zQbaxpMPmStaFUitic0kflwtPRSnL6ZEVu5b8EM1jyE6XVULV6wSq58p38Ylg5jdm/ELqZw3O1zs6DqHujikq1a781qohNyc0EJg31aFLvRfmStS3OTUdf3D40R/vIWIcqBCQQrCqzu95OOQpy0884Vgmw0UD5dKc3wlnPuv8ibuMH/kyr+/4xv6oVAGvElPggHLVG4aFW3u+KSnoI06RddLJFi5V3k2zp1IX99Xenalf7RNQ2s5k3hm5aVJnNyToWP2w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(52116002)(26005)(6666004)(8936002)(33716001)(508600001)(4744005)(6506007)(9686003)(38350700002)(38100700002)(2906002)(1076003)(6486002)(66946007)(86362001)(6916009)(6512007)(44832011)(33656002)(186003)(66556008)(66476007)(4326008)(8676002)(316002)(5660300002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KhnyjJ06dYIHVcjijC2xkczN7r65ifIOeSKpsqu4kMlYPiPKSRemN83S5uwz?= =?us-ascii?Q?WO6Gm0/Hs8f30hgZFc9NQLz73xSogRozB7LbWZu/mV4dUyPZUcrGJUy3HZYj?= =?us-ascii?Q?UNLflwOEV7WQ+Y5D5GV7dzopzJoOHsE/3iOQoDCR+Mus2xrxHrarFXpzREng?= =?us-ascii?Q?SdhtYaHOjekjt7oduxePkP8Tf/pX7aEhKAN8znHDBChi6NuiCiAC+pX+BQAF?= =?us-ascii?Q?K1/tkT92wdibh1i99IrxsMSTU/xuhsox59lT1O9Db4z2mS1rUo7IaqtD433s?= =?us-ascii?Q?NN7mH+JXaS2hFWY3UlfZro2OTdZzOmbQU5f4zqrjBX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hT2trc3DcFyW5iNuRATid6xxnj2BBaAJuoxuBKRsq0YO611xlI?= =?us-ascii?Q?giX5k6kSSBcClm3dyrNZv8QfzCP9zrpVnU36g7P6cCQwBKTq8D391ZpMv37l?= =?us-ascii?Q?hC2N1zq8KLrCo8+uUH/61IM+iZX2nkHN3suK2FCFACsbb2mjrb4OP63sLRjV?= =?us-ascii?Q?SrpeDqfLZ9DVoNSv8RcAoIriUpR/aFwo/QNKUxcR/34V6gn79J3aBrWJb16Y?= =?us-ascii?Q?EvDF1b5Qz/XC+VbdIu9JBgVlWAyieP5MYwc2kXj/pzWv9KBOXgS9SdlLcjsE?= =?us-ascii?Q?V6zjEfaptvGNEXfXIYlW0q9HqVSvJO5PO1CqpgFLbdx9VeIloZQKarVotJwP?= =?us-ascii?Q?fmKBedQd3eULM/ZFNMBWa9jbWxe4Clnvy1HLYIoR1J5bWStsZuUNvi3IPQnc?= =?us-ascii?Q?/Xq/K8dWDZUx7kLHdjCIpfBO5j3Phs5tJI48NjZT3ah3U1sG8/mLTph8ntyA?= =?us-ascii?Q?8pkDrruaHrZ4OgLW8RQhAenqvaPa9jBrPJ4M+Ud1QN1SvW50pUlqv7ogl/S8?= =?us-ascii?Q?2SGQBIpWQD7XjzDlmULjK410UdPshnY=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1e08536c-950e-44a6-f8bf-08da38a65689 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2022 08:13:49.5674 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: I/oXwYlrU/eLIF4Y0q85TSQLL51rYPCUwZdhwGcDITk8tL3utAPsnMn8pn3/AN93BcqG2802QupzJeJGYg3HmYjYbjwCSGhtiYGMhPVqnQk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4710 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.486,18.0.874 definitions=2022-05-18_02:2022-05-17,2022-05-18 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 phishscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205180041 X-Proofpoint-GUID: oBbOwswWG9DzkcV67Sc1Ybj694-3p6eb X-Proofpoint-ORIG-GUID: oBbOwswWG9DzkcV67Sc1Ybj694-3p6eb X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 18, 2022 at 03:59:57PM +0800, Jiasheng Jiang wrote: > As kzalloc() may return null pointer, it should be better to > check the return value and return error if fails in order > to avoid dereference of null pointer. > Moreover, the return value of rtw_alloc_hwxmits() should also > be dealt with. > > Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver") > Signed-off-by: Jiasheng Jiang Looks good! Reviewed-by: Dan Carpenter regards, dan carpenter