Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1811508pxb; Fri, 20 Aug 2021 14:53:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN0lVTaKUkGIqEcnvrn4wHFo43mipzXPvpYlnFCA5KCSBE5wsXUUU6peeyQ4fiZCIDxEaT X-Received: by 2002:a17:906:eb02:: with SMTP id mb2mr2525127ejb.360.1629496395512; Fri, 20 Aug 2021 14:53:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629496395; cv=none; d=google.com; s=arc-20160816; b=i1fbv22fqZvyUZO4zqlnLEI/pvLgd69T4rHaIM7QF8ypIYDB0UswL+7jbaZabXXvgp eFsNmzh76WlentYnHO6HGlUN4hD/7HGd9ha7MTXpnEZ8EgbHXWvchzS/bMDn97PQy/u6 jW5Gyl8w31ThfxYb64P7WbrF4eHGQV2dYQmMmcqGj7hdwXfxcaNlIho7j4ns559VPEFr PrRCQ5Bp3fubjZEZ0Y/hgIbztGebVkRqDemhUHmVXShmp7a4CmjKrLC7u/lvWcvd5ZxP 7MdiXztrx7DjWLA9MB0e7MkDhG30KnLzX+pEp36pl57YyIzdPSoWglg+bUKFY9A+9YJF w6RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=KtF4JikGirGmEWSBEEKstne20Z5mP6gMbaTtDOFM/E8=; b=G1MIpSYjKqJWtk10DaycLIoqrQ96EsmPr4xA+lg37NOD6Wx7BUOA+E3qVMztPuBRTo OsuAiRTH39thmaIBOLXJdl9yV8K29cy4T+bvQxVHtIzB3rps7OXG0wSbBIlS6+92Mc2f LCq6DufN1RxW0xXuYoKm099NjYy5gI+V/CJOgtAibbhtQ0gprFkHnZEH9p5wzm09QE7O YJT4gNoIPsa0XHYl/N11j8dMmgI+MfVsphew3dCbs5Oonwo+OholLDTHDhMZWKRUFj+D bGEIfwAmzlQWHMpy8dxYcsvq6ljR2ukUy4Ir+2EQHOUcujC8r6E44i1B6o55V+sLt4x6 +klg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O45Q8k7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si873442edd.226.2021.08.20.14.52.47; Fri, 20 Aug 2021 14:53:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=O45Q8k7Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231615AbhHTVvW (ORCPT + 99 others); Fri, 20 Aug 2021 17:51:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbhHTVvV (ORCPT ); Fri, 20 Aug 2021 17:51:21 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78497C061575 for ; Fri, 20 Aug 2021 14:50:42 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id j12so4998468ljg.10 for ; Fri, 20 Aug 2021 14:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=KtF4JikGirGmEWSBEEKstne20Z5mP6gMbaTtDOFM/E8=; b=O45Q8k7Yv6smbjwukTq/JsAAARfnKcC3r7i3flcvoMjRjOUcoP+1DGaEox7bCyphcR mvJK824Yl3Ncf+EcrlV8gUMIFUfgZH39OA5LQb2+EeJZU43erBhgJGEu2E5gPpA5e3K+ 0Jw+EJzopRpPMCj4xmAYGMAazISBRMzVc7tdL09lIBgp6Vzskzh21I1wPyGN7kJkMNv0 Yoa3qz3y8EtPEr+lDEE8e+RgDtG3+If4Jqm9WxWw/oo/mJ2pyXGrjFBeyqRBIIVA3/EA VrbY0mk7/rW0JOVXrSpf4Ms6XVBeA3UDsnYnlqJf0gjzb8/ICAyU/didwOn/H7da8qZ1 wZKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=KtF4JikGirGmEWSBEEKstne20Z5mP6gMbaTtDOFM/E8=; b=HuA/4SV1OCvazGUZOeCaRevX2pdsSc4oH1rxUkUCXi9pUWBslyvghZR5F/lqT/C0EB fllphH0aWqCA1CTev8DLBeRcUQLamdSaK38CrCwiCh9xTj+FuvlPST/UDWfRWdOuk3a7 4dLFdgb3UcqjEoQZ8KG0tFWBnx282le1JAkdSDeqZUYsIo+W0fziy6s2Wv1j7Jix93Mm sLuay8sv0TC5DkqBj1kNaq9jliy4PVgxLyXUDUXGtS96htpX0yI2eV/c6tB/mRDnxDN5 cRlaeL2ePGNXFoLZaauPu1Ya3U91Px7M6gS1uESPRi3sxlEskpyVfkKdUtSI+lgQzxHT jH7A== X-Gm-Message-State: AOAM533t1JP/vIil3mVYpl0cy+Api+1vTJi7XKZKOxeLC6EnE1pisF9q kQ1JJBGpNr/+0DWFn+bPo9CgQUGxfH5bWg== X-Received: by 2002:a2e:9b12:: with SMTP id u18mr17472707lji.350.1629496240457; Fri, 20 Aug 2021 14:50:40 -0700 (PDT) Received: from [192.168.1.11] ([46.235.66.127]) by smtp.gmail.com with ESMTPSA id c18sm328376lfv.268.2021.08.20.14.50.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Aug 2021 14:50:39 -0700 (PDT) Subject: Re: [PATCH RFC 1/3] staging: r8188eu: add proper rtw_read* error handling To: Larry.Finger@lwfinger.net, phil@philpotter.co.uk, gregkh@linuxfoundation.org, straube.linux@gmail.com, fmdefrancesco@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: From: Pavel Skripkin Message-ID: <29de0bb8-efaa-1625-3f5d-04332c21ddc1@gmail.com> Date: Sat, 21 Aug 2021 00:50:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/20/21 8:07 PM, Pavel Skripkin wrote: [snip] > @@ -336,13 +338,21 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf) > > memset(c2h_evt, 0, 16); > > - *buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL); > - *(buf + 1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1); > + *buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL, &error); > + if (error) > + goto clear_evt; > + > + *(buf + 1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1, &error); > + if (error) > + ; ^^^^^^^ Should be goto clear_evt;. Will fix in v2, I want to receive some feedback first :) With regards, Pavel Skripkin