Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8080519rwi; Tue, 25 Oct 2022 02:07:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM47I0IS5mRleNBwHhTR4COea3GIyYaDFiX9CyOCT2jyX7HjbQMGJueDKq2d0fhAu6KLHgi3 X-Received: by 2002:a05:6402:847:b0:453:944a:ba8e with SMTP id b7-20020a056402084700b00453944aba8emr34149171edz.326.1666688850753; Tue, 25 Oct 2022 02:07:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666688850; cv=none; d=google.com; s=arc-20160816; b=iYKkzw5X8Zu95A7VJ6hWpZ0qDT0Dzs3WN/+j4F2vWGjR/8t6SVfVkLR+cNIxRa7ZOv 2Qn4rXA9beY7SIQgC5Qxb5X2bEtum8wTJuHGZRPwnLd6MrHCx4c19kQK6P7cQmujcYwp s3TQQBB5StxNVcUzCtDlwO7TiT4rWe74HNdlOmUhObz4IW2cqQCfhl9EuUUiYDGWf+TQ LhvRqAS/Nu1umidDcdiUAxuKhzp1XGdvnt0g2iNPbVXbUSG0w/YO97C6GciOE9jLYtPT 1jHDOx1eTRRWz1qtipbwRvJcZer7Yub6RqX/NR5sGBz63wyuxFe7OV6VREUmFRTKsdUO 5GLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ezeNa0KTk2LzeMG5JhgWIVDQRQDMmtK5jUjmS8DSveY=; b=uxh+Kjd+VojAlEqnhXwSzAsWZYoWwl3DxJ5qA0iS7EKZ6Ycx6qAymqQpIi3nxfLOXS JSu7IFQrdLgkmMPy0YSpjWDakvMICbZMkv5YvkLYRzmmxY8RnCY+xUUqk/J56SlFRFzq pXC487EwMVnAy7lKiQqIXw9kwdiwhrDoGIn+YpM8c9H0In5zR+wE5SiFOPKfRZDkJJvp dX88wHUdwuyV05NhqKdkbzBJWfS+l3LlXbY5rNg2oc3t4vk9fTmILzdn2rXXUcu77tIk zH952qUar48HO0QILv+caJ4QButVhe09rwjikDRKNO3xHts2H7HNXySGeDT5L0ca+A6E 8r8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aSnigHEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a17090652ca00b0078e063fc787si1804351ejn.433.2022.10.25.02.07.05; Tue, 25 Oct 2022 02:07:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=aSnigHEo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230259AbiJYIyP (ORCPT + 99 others); Tue, 25 Oct 2022 04:54:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiJYIyM (ORCPT ); Tue, 25 Oct 2022 04:54:12 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF985139C21 for ; Tue, 25 Oct 2022 01:54:10 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id a13so35275386edj.0 for ; Tue, 25 Oct 2022 01:54:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ezeNa0KTk2LzeMG5JhgWIVDQRQDMmtK5jUjmS8DSveY=; b=aSnigHEoQW6zMZsvzBlSGlaGf/YJDJY/viTwyD/cryQ1AAM2cMo/yR/u2Xvd5aB8/l nKMIxOHRqxMp24TxH0yY75kjQVLu6r0ggRki31sGz9OWSsMEw3y1KThHkFxxmYJDQzQR 7MzDSzXmGdWt54DU/MMi6A7hA+gmLqCamfnHUffOlsaNs7oQ2VzAOOdkDz0IUCkOGGXJ YQIHst7yoGMGu1VkeUEthj5tB6M2MyTbLypRMNB5mVFbovKv2+uRrzPZywpUAwzWwELb sYVtS1PzLeZ23ZPr9TAaNqHJhAaSqPwgSwG3235pZt3m0dtEnLohZrEqRH2jLBsTvvQG +tmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ezeNa0KTk2LzeMG5JhgWIVDQRQDMmtK5jUjmS8DSveY=; b=Z/SHKBrjSZ3lfz2btDCgHEdN/b8Gg+UG8Bfh/qTjqWPWKjK+QKCtI53FiQrBKJGMFT oHsQ6nZIMaMPGt7uV7p/StsaZZEckYbjG0+5lO3r5WH8h0Rj796W0DjGChddpo/aai9d a7d1VzBygpurcEbjY31dKBC/ynfvRc1TE+ZTuaBJHyi6ddHdAosdDqgNlI6bZu0ORpqR Wkefq9dLOsYQufz+SdFPyFb6TywNtqbWaz2xMWadTguybtPQ5fUcFDZdiCOKFymu1sVC fUSr1wp84UydXdbUtaoTzmBOuGM/Ky4iyl7lcinND71/iujserzdViL/FsgY4Q5SOXSW Xysw== X-Gm-Message-State: ACrzQf31GlE9dFJG95GH0fkEBksKDnPWhbhRxYkUYZryh2tuk3+9iU9V tmMBcgrMg8+000Jcz3Xxxexi2G7sCd0= X-Received: by 2002:a05:6402:1d86:b0:457:e84:f0e with SMTP id dk6-20020a0564021d8600b004570e840f0emr34418751edb.241.1666688049383; Tue, 25 Oct 2022 01:54:09 -0700 (PDT) Received: from nam-dell (ip-217-105-46-178.ip.prioritytelecom.net. [217.105.46.178]) by smtp.gmail.com with ESMTPSA id er5-20020a056402448500b0045cf4f72b04sm1200945edb.94.2022.10.25.01.54.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 01:54:09 -0700 (PDT) Date: Tue, 25 Oct 2022 10:54:00 +0200 From: Nam Cao To: Dan Carpenter Cc: Larry Finger , Florian Schilhabel , Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] staging: rtl8712: check for alloc fail in _r8712_init_recv_priv() Message-ID: <20221025085400.GA246874@nam-dell> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Tue, Oct 25, 2022 at 09:57:38AM +0300, Dan Carpenter wrote: > On Mon, Oct 24, 2022 at 11:24:07PM +0200, Nam Cao wrote: > > The function _r8712_init_recv_priv() and also r8712_init_recv_priv() > > just returns silently if they fail to allocate memory. Change their > > return type to int and add necessary checks and handling if they return > > -ENOMEM > > > > Signed-off-by: Nam Cao > > --- > > drivers/staging/rtl8712/os_intfs.c | 3 ++- > > drivers/staging/rtl8712/recv_osdep.h | 8 ++++---- > > drivers/staging/rtl8712/rtl8712_recv.c | 7 ++++--- > > drivers/staging/rtl8712/rtl871x_recv.c | 13 +++++++++---- > > 4 files changed, 19 insertions(+), 12 deletions(-) > > > > diff --git a/drivers/staging/rtl8712/os_intfs.c b/drivers/staging/rtl8712/os_intfs.c > > index 003e97205124..47d7d998fa86 100644 > > --- a/drivers/staging/rtl8712/os_intfs.c > > +++ b/drivers/staging/rtl8712/os_intfs.c > > @@ -309,7 +309,8 @@ int r8712_init_drv_sw(struct _adapter *padapter) > > if (ret) > > return ret; > > _r8712_init_xmit_priv(&padapter->xmitpriv, padapter); > > - _r8712_init_recv_priv(&padapter->recvpriv, padapter); > > + ret = _r8712_init_recv_priv(&padapter->recvpriv, padapter); > > + return ret; > > If statement missing. Probably a rebase mistake, the if statement is there in the last patch. Will send a v2 nonetheless, thank you for noticing this. Best regards, Nam