Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2942654iog; Mon, 20 Jun 2022 07:59:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uD+FYUgdRMFLmK5U6H+cs7RkNNWZg0LUZZSqwZJXzoAYcl0nS6ssivmquCTecYrNh2WVG8 X-Received: by 2002:a05:6a00:b51:b0:51b:f772:40c5 with SMTP id p17-20020a056a000b5100b0051bf77240c5mr24890187pfo.22.1655737173656; Mon, 20 Jun 2022 07:59:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655737173; cv=none; d=google.com; s=arc-20160816; b=hUhDTzlm6qrx250zq+hM7pA+zUW5ucZ1x4qnkm98ftoU4qzZT5jXib2sAiP2bQRHRx J5xTM4XOWrTEWhiY+YT4d0HQjBuDfLpDiyfo/RIf027L9voodvcXyVv+wLYfVfotsw23 9tM3QjMDA06PwoHw905QxeLnv53cWmcSVczL/EBlBPlAyVpLk1RhzHmODpdkwYvpJPy/ HjQEGAZ0z5OhfS9/8FO4w11rQwtoHhntGk3L3bxH9fWHxpF4au0N6+wxTYnrxHQrFNf9 7Gqzu/coIMPiIl2rVhptg7dIFToKpTifIMYhvL/7/NPbwVrjIkRsbIkVA6wvV0Ch8aqG PUoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:dkim-signature; bh=vXVWDTnjO5iC5dEoRI4X2EQajSgnoxnE0S9FMk/nHYU=; b=IDgPmuO6lQ+kmv9zLhpEMM6+F9E2CrsZ9T+TFmOlVfV+h7r6kNxjO+a4+gSwuz6h8Z UXTZNW8dDUr4F2jSUH3ErA41x1Lnx05XjcQiVyPtOBTT/0k7DVFhURPpefank2u/u40I 66R2NyR+ZHLoKEDKFN3x7d9Z+T9kwVtSuL7+D+qrOLzDoIiafIgS+F6CqqjV/9BJLkoq wWVi9MTS5/RUCbnVDmH9qoEowcXM17mFljZY2b/r1fzjNaFoOp9b1gapGBdg/gwhGqOG RDU8CHpnLCqN1811ePdJ90eao6BpPuStHhCLY3JLYMcYQclklbdk2HKMpWaQ+ISQ/yz+ T1Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NbkOEcR0; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a63f947000000b003db379692e2si9950498pgk.181.2022.06.20.07.59.20; Mon, 20 Jun 2022 07:59:33 -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=NbkOEcR0; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241833AbiFTOpp (ORCPT + 99 others); Mon, 20 Jun 2022 10:45:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241643AbiFTOp2 (ORCPT ); Mon, 20 Jun 2022 10:45:28 -0400 Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88C2536311 for ; Mon, 20 Jun 2022 07:05:19 -0700 (PDT) Received: by mail-oi1-x231.google.com with SMTP id s16so3785262oie.3 for ; Mon, 20 Jun 2022 07:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=vXVWDTnjO5iC5dEoRI4X2EQajSgnoxnE0S9FMk/nHYU=; b=NbkOEcR0dzXkLTMiHTHvNRRd4rEdnU+Lu1co9BuL9idLgD9YJn57kxjahkLCi9nA4g ePESFqVcfoiS0stnNjRdsQYtu4OG2a9egIevdIN3qIiqIWPzPYKMCxg2jrEcoC2s+Be0 sbFTl2vTUH30+60YCoRRzEe6PvmKKWbGTBedUaELE86637ZFnGqQ96nUExzsGH1P7crr a7QViE8xQXkevkISzpgAM7Zr5Eo1GEiUPNbJ8fBMhnRCc7wjsvlOv3ag7cuO7unPOc9K pN6ELKTqquaA5tSGDWBW3v4jSCjQe46zyg+4RL+is6/yhPWw/dZqrx9wn9MpX+nZNSXd T6PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=vXVWDTnjO5iC5dEoRI4X2EQajSgnoxnE0S9FMk/nHYU=; b=HIYiiAM0uyoie7yR/SQ5gknTh/s9zL1MqnZ2ZxEypLYNNAjiLfpHrzTR955kLb9ib9 PLGbiIqerOzeJFLXSy4ua30Ghnl9urmbnA5dscfaSPzJn5+TTL41f8P0k68WG5ZoKlZU j708yJDHQcr+4nRnHQZSl6zD293z4zUo31NpCpkW0rT8Ph+pDFV9xMUFMD9uYCn7k542 JD0QQBnPszQI8eEtS9w3eITy3SL7QSBjdcq12oAjLDeazKek87l4hjx/pBDsOrPD3KSU W+x/YIXomvzJDjlHXGkLtxVKXVTecCOY9XuK1Gz8Gznlc9U9W9FZMJcbdNmXlplC2QMP xD0g== X-Gm-Message-State: AOAM530O7GfRSk8hGzuaEa0U652wv5ZC+KKfwelhNpfTC3LaIHnLevBi y53l2IIs7TIStCHoUtBX0Sc= X-Received: by 2002:a05:6808:1989:b0:32e:9e58:7733 with SMTP id bj9-20020a056808198900b0032e9e587733mr15579850oib.270.1655733918795; Mon, 20 Jun 2022 07:05:18 -0700 (PDT) Received: from [192.168.1.108] ([216.130.59.33]) by smtp.gmail.com with ESMTPSA id r23-20020a056830419700b0060c03836d04sm7651254otu.77.2022.06.20.07.05.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jun 2022 07:05:18 -0700 (PDT) Sender: Larry Finger Message-ID: <5396e576-0fbe-430c-d983-a2f4b1569f09@lwfinger.net> Date: Mon, 20 Jun 2022 09:05:17 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH v1] staging: r8188eu: an incorrect return value made the function always return fail Content-Language: en-US To: Kate Hsuan , Hans de Goede , Phillip Potter , Greg Kroah-Hartman , Michael Straube , "Fabio M . De Francesco" , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20220620085413.948265-1-hpa@redhat.com> From: Larry Finger In-Reply-To: <20220620085413.948265-1-hpa@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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 6/20/22 03:54, Kate Hsuan wrote: > Since _SUCCESS (1) and _FAIL (0) are used to indicate the status of the > functions. The previous commit 8ae7bf782eacad803f752c83a183393b0a67127b > fixed and prevented dereferencing a NULL pointer through checking the > return pointer. The NULL pointer check work properly but the return > values (-ENOMEM on fail and 0 on success). This work fixed the return > values to make sure the caller function will return the correct status. > > BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2097526 > Signed-off-by: Kate Hsuan > --- > drivers/staging/r8188eu/core/rtw_xmit.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c > index f4e9f6102539..2f8720db21d9 100644 > --- a/drivers/staging/r8188eu/core/rtw_xmit.c > +++ b/drivers/staging/r8188eu/core/rtw_xmit.c > @@ -180,10 +180,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) > pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; > > res = rtw_alloc_hwxmits(padapter); > - if (res) { > - res = _FAIL; > + if (res == _FAIL) > goto exit; > - } > > rtw_init_hwxmits(pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry); > This problem was fixed in mid May with commit 5b7419ae1d20 ("staging: r8188eu: fix rtw_alloc_hwxmits error detection for now"). The fix was @@ -178,8 +178,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter) pxmitpriv->free_xmit_extbuf_cnt = num_xmit_extbuf; - res = rtw_alloc_hwxmits(padapter); - if (res) { + if (rtw_alloc_hwxmits(padapter)) { res = _FAIL; goto exit; } The "for now" part is that Phillip plans to get rid of _FAIL and _SUCCESS, and replace the logic with a normal 1 for fail, etc.; however, this will be a major change that must be done carefully. In any case NACK for this patch. Larry