Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp82126ybx; Wed, 6 Nov 2019 13:34:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwA3ap7XiMT00kf9DNesCd82mM7T6gaGAM4VrUSboySvLMsNlKMKtU+nIw3esMssA1CfEPI X-Received: by 2002:a50:ff12:: with SMTP id a18mr5128103edu.200.1573076087558; Wed, 06 Nov 2019 13:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573076087; cv=none; d=google.com; s=arc-20160816; b=ddYcTGBihGN0ZJfLrSNu9gVAaggm7nYOSOcF8+NKIlWvtdTZ7yJ7xJTuPWLZ9yVZZJ OYF2wj381TkryFabtOiKB9sjHcxxahhGTcpjpUQ9DNVd7U++liOc/hyQj+sMg1jM99gv xXLJOYSVjFL4vj69Y1qzHxX1FxVuhc0sN2hQoxBtfBbnD6mDm45oLiX0LrSfPViCKU5w lKJal5srDa20ooywgseCHPQRp378nDHC5KOsAeudOKUHsYXDDapWCmSGOHdWTTqiyLh7 3Iu/6jmDURiUAVR10iCw/9FGAs4KwZ+AtUuGWH3TwZQ5ns9eL1WkuTHIHoUJzcqV/0HR 4wJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=hsQZSOuPgDEYpkRIrusPrGiXr3Pj9L1UQOuSWwbS3J4=; b=ump/XiRUDHzEc3O7ksiRIlvYxWDQBh4ZVe7hVYbHlMOjx1x8P64LM2teH8yo6TIqyr 0giugcsINHGRq8GqmNF/qlFrdop4DSUmfMSyj4DsksEVU2InJ0QZcTMtcezqYIy8k8Qa X9V8bnfkRvVl5fusbOJasnZTrjCKLklwfrH9JP1wJia+u0PUnYhe7EdFSxAYy+Q3CVsG SEcKiRGYQkzl/Fw0PrsDNjtxAQndkSgW8QaldDxA51qVVCZRF1OnWhpj/4kh1I/+5WZp cjivlpHpB7xTscFDT+E7la0u2XRKn5fe4Va0RD4cEh/cTdVXb0KZy5amOOl6JRfxFGdb t10w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TDhc43FG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si13671482edx.257.2019.11.06.13.34.23; Wed, 06 Nov 2019 13:34:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TDhc43FG; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732606AbfKFVdS (ORCPT + 99 others); Wed, 6 Nov 2019 16:33:18 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:33596 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726798AbfKFVdR (ORCPT ); Wed, 6 Nov 2019 16:33:17 -0500 Received: by mail-qt1-f196.google.com with SMTP id y39so13601qty.0 for ; Wed, 06 Nov 2019 13:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hsQZSOuPgDEYpkRIrusPrGiXr3Pj9L1UQOuSWwbS3J4=; b=TDhc43FGHx5coIphtrOFLFpgoH8tAyZKogKDj9fn+mGb/xbXUDffMPQ+MUrEKY+d6G W1U2CG+X336Euat8UBzHaBzYhTDGyG7yMo3Xwy9/gH9U0R4eZrvAD2W4Qv6C3Zus6jHb qTyHRJgk71ewf1NdL52vKUZjkJwcwW6AWO9tM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hsQZSOuPgDEYpkRIrusPrGiXr3Pj9L1UQOuSWwbS3J4=; b=T6Mw7wv2T3LzybUC+m47ExqCmWCUZe5RY+zhFu60M6iZoQrbYbVo/tXpJ4nnl/00N5 qPeXNoBK+YWu+GL7WxuSHLnuCBcjarwoThi+xEPGWUqUwT9Ywdv7ffitNVh2oE1vZfea FrLQPqoELXFqyiSXauTrsBmTgeJyxs/c9YuKF3vkzZfkMDPt6YWv95ZhyT1cEAKCAtik PxcYFOQhfPP7i1PpNYEWaV7p0TCWZnqaRVr4OXDNQgmuxgznnjHczOO7wQgbgtZyDcKw alYqBNTlljB8AA82S0OyChao1tK1uzO3OxxM6B4dA72iBQMRRuNI4qOuDa48Kt0r+2h2 Q+1Q== X-Gm-Message-State: APjAAAUORW6IWyIaORVsswuaHZNyRYJcbW16yxwDlUECU7NjND+oeelr KsUxMxPCoaEm6VGmMMQQXI93x34kRzk= X-Received: by 2002:aed:20e5:: with SMTP id 92mr114177qtb.294.1573075995979; Wed, 06 Nov 2019 13:33:15 -0800 (PST) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com. [209.85.222.178]) by smtp.gmail.com with ESMTPSA id o3sm33740qkf.97.2019.11.06.13.33.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Nov 2019 13:33:15 -0800 (PST) Received: by mail-qk1-f178.google.com with SMTP id 205so131536qkk.1 for ; Wed, 06 Nov 2019 13:33:14 -0800 (PST) X-Received: by 2002:a37:9cc2:: with SMTP id f185mr4314085qke.2.1573075994285; Wed, 06 Nov 2019 13:33:14 -0800 (PST) MIME-Version: 1.0 References: <20191105090442.8378-1-yhchuang@realtek.com> In-Reply-To: <20191105090442.8378-1-yhchuang@realtek.com> From: Brian Norris Date: Wed, 6 Nov 2019 13:33:02 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] rtw88: fix potential NULL pointer access for firmware To: Tony Chuang Cc: Kalle Valo , Dan Carpenter , linux-wireless Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Nov 5, 2019 at 1:06 AM wrote: ... > Fixes: 5195b90426409 ("rtw88: avoid FW info flood") ... > --- a/drivers/net/wireless/realtek/rtw88/main.c > +++ b/drivers/net/wireless/realtek/rtw88/main.c > @@ -1024,8 +1024,10 @@ static void rtw_load_firmware_cb(const struct firmware *firmware, void *context) > struct rtw_fw_state *fw = &rtwdev->fw; > const struct rtw_fw_hdr *fw_hdr; > > - if (!firmware) > + if (!firmware || !firmware->data) { > rtw_err(rtwdev, "failed to request firmware\n"); I think you still wanted 'complete_all()' here, otherwise your waiters will hang forever. (They correctly check whether the firmware is NULL, so that's not a problem there.) I'll send a follow-up to the follow-up :) Brian > + return; > + }