Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp93476ybt; Tue, 30 Jun 2020 15:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmMAexLIjxL5z5DqpComcccFFz+wLjbI5olctR5Px5Bh2+lEkfZzzQt7JoE64fEI+iFQRz X-Received: by 2002:a05:6402:1c96:: with SMTP id cy22mr25014240edb.79.1593556403179; Tue, 30 Jun 2020 15:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593556403; cv=none; d=google.com; s=arc-20160816; b=W8MKfsNL73HMMx2JzhmAX+Tbp5aetzrfRjlQFbsQe7/Cy3UXWZoEeqQFFX8Siq65w8 4NLk6+INCYI51sBXVgXDNR4qwh45UszXxW5yfoCq2h6E8Fs7vSyZqFLFSkdh002AYNm0 0Gj0ctxql+rVIqbKSzFS+Sz+n2NOjfF7b0gFpjP7n8carcNsAtSGavzoRpIn7IDmFC3Y uVO1XBcz6YVHTLvq+cNY1mpG7sUginDTPikxjW/eq84t/yB3TDXyls7Z84rzBDiL37Oy 9lYCsFWquBAJHW4V3ZwXoeklcfWsXqNVOTKKQmXne9MIvQxUY4n0dw6BEUD2WLLwrPD3 MuOw== 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=oX8IEcCQ042Y8Jh028safSbu4eOF6OaEoT6uY1IVW+w=; b=YwdA8veeX6II8YW3PDWZzDgdZI6RqChIFrFl81f33jQArgUYLeE9arMUMLfdxsEoqV iEsC9syXJcDAsCQynatqO9sz5usPQPqwgYpWgWe1Ak8R9zvFUyBvW6bctDz6Awa31zYE 0qs0ZiN3uihxBP3nEUBgezOn/Wj5fUmiWtNp294TZsV3PwIngIhOrXAgWswp5GPfQVgR DgSnrkKBQcqTlUrs2nMEQvVqz78kXksGnQeLVe1wZj0GtKzHIYkl5dlcr2OXWg/vDbU8 UT2ZPfJoRR6T4uIEvz2dihctfLXGDzakE3vZOalQTNlraDupBDBACgjBLfUKkpB/GGcC hHUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EHpAeSv7; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si2440727eds.491.2020.06.30.15.32.58; Tue, 30 Jun 2020 15:33:23 -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=@chromium.org header.s=google header.b=EHpAeSv7; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726192AbgF3Wc0 (ORCPT + 99 others); Tue, 30 Jun 2020 18:32:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726065AbgF3WcZ (ORCPT ); Tue, 30 Jun 2020 18:32:25 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D5CC061755 for ; Tue, 30 Jun 2020 15:32:25 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id s20so4826270vsq.5 for ; Tue, 30 Jun 2020 15:32:25 -0700 (PDT) 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=oX8IEcCQ042Y8Jh028safSbu4eOF6OaEoT6uY1IVW+w=; b=EHpAeSv7pNUbvTVcX9DVF1wwyqwBTF9dIfFVsfzDuxUAJ4guzmbP2dnLrvSho6kywo N+YgkqHOlOEaM9Zg8LI1vN5A0tm+d8HB9Pa6TVCDMfvb561Rm1MLkCBYyd2Hkm9RuSly wFpg/m1xHweCeYTfTDUTpRuuRWWAB2GYlv0kw= 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=oX8IEcCQ042Y8Jh028safSbu4eOF6OaEoT6uY1IVW+w=; b=NkmGiftF/rhYnbsPc/gsn40He1F8Zwdt0GhpTNKvGSj45UiTMVrTpsZAezq4Jt6e6r fH41fr3NNmejrU70phom0gRzmovvLZWYGkdLtEv86vTc4Jme97QmqFtlssjngy9hnqB0 Tm96fC21EWyJojANcjDmcu9T9vu8B9Dk6cny1oBGqv/ZN8uFEFDWiFF7hA8VCnFOaBJ6 sbYJYKoY2HBaJZYSbRGqc6967LlFnuyOUtXRntl1Wm81INcpCu+of73jx9lVRPmfOZzG q639v1MYHYOU7FKo7PwmT4V64Ypg/OFoMG/PZWL84gxAyuyAv5LJkXuvhrR67cLATbcW HQLA== X-Gm-Message-State: AOAM5327yloWHxaT6tR7e5SvWWIL6fTIRl7B2rxEl8Uwet4OyPo3cmRn lX0Vwjwg5DPEY6ZH7W4eAsjfM94Cuu4= X-Received: by 2002:a05:6102:20a:: with SMTP id z10mr8928231vsp.213.1593556344213; Tue, 30 Jun 2020 15:32:24 -0700 (PDT) Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com. [209.85.222.51]) by smtp.gmail.com with ESMTPSA id f133sm647548vke.23.2020.06.30.15.32.23 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2020 15:32:23 -0700 (PDT) Received: by mail-ua1-f51.google.com with SMTP id q15so6847955uap.4 for ; Tue, 30 Jun 2020 15:32:23 -0700 (PDT) X-Received: by 2002:ab0:2408:: with SMTP id f8mr8448016uan.91.1593556342676; Tue, 30 Jun 2020 15:32:22 -0700 (PDT) MIME-Version: 1.0 References: <20200630082922.28672-1-cengiz@kernel.wtf> In-Reply-To: <20200630082922.28672-1-cengiz@kernel.wtf> From: Doug Anderson Date: Tue, 30 Jun 2020 15:32:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] kdb: remove unnecessary null check of dbg_io_ops To: Cengiz Can Cc: Sumit Garg , Andy Shevchenko , Daniel Thompson , Jason Wessel , kgdb-bugreport@lists.sourceforge.net, LKML , Petr Mladek Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Jun 30, 2020 at 1:30 AM Cengiz Can wrote: > > `kdb_msg_write` operates on a global `struct kgdb_io *` called > `dbg_io_ops`. > > It's initialized in `debug_core.c` and checked throughout the debug > flow. > > There's a null check in `kdb_msg_write` which triggers static analyzers > and gives the (almost entirely wrong) impression that it can be null. > > Coverity scanner caught this as CID 1465042. > > I have removed the unnecessary null check and eliminated false-positive > forward null dereference warning. > > Signed-off-by: Cengiz Can > --- > kernel/debug/kdb/kdb_io.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) Reviewed-by: Douglas Anderson Tested-by: Douglas Anderson