Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1886092rwb; Fri, 11 Nov 2022 01:42:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf49s7eeQY4IbMfsOBpgPzhR8Ho2iepJMjVCzhaLaKqcsaPH+LC647SYDRZPrgXWWUSnTzyL X-Received: by 2002:a17:906:f8d6:b0:7ad:a0cb:f79e with SMTP id lh22-20020a170906f8d600b007ada0cbf79emr1148262ejb.458.1668159724526; Fri, 11 Nov 2022 01:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668159724; cv=none; d=google.com; s=arc-20160816; b=YmtqyM0XnAh+lBIT12COvR8B+XRsqcUViaWcTgpcV91Shsq6bIW1mqSx0KceJ7KAOL TYnq07PbAjBjyamiZ7STm/UWzeiLlc9qCUf4zgSqE4TbqJ/t21oeQACkLE7tU+5GSK2J DPPve6CSQkO2RoPPuFGxx0lAvRDjoZ9aWBe/ifdDeLkjtvR2pb1SlH3Rphp6Hlafp0fn rtYGSLnrMFJ/g9U8vZWiu4EU6OEi4NIPwlx0h2N6JH/zkHJuKiCy7YVhOm7OePmguuHs oq+T/Hv6RtKyzwqQtKo0GArwFTrwPMdNkFtbbhithfXUO24U9D9+C6ydTNdPFVl91n7D wvCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from:dkim-signature; bh=oXKKUr8pyq/MUmMTu6s22pi0uE7YLGQXLgb5KRJw3FU=; b=oJtpIlP09R2m5FVLAfHOF+lFafbr3dFg2L26BbuypDKpTOmIoUbVjU475DZ/1dCRt+ ZmePed2rLaP/rslkrUu8tiQFtsP8Bmpc5r4eHzdS5X/RgA8ZvuHAY/YBdaPYF3PTgGbY wd9LEZ4JYbNcVMm2elTzHLFAOz8SsGEfC20NQ4H0OUJ8VIaf9fZEZ3SOdb2qRJ0shoBA 4AiHgHye6Lvr2ZH6/Ca3h3LGv0iIGc7rkPP8j3nPE+eyY/alxYVbSuyEScLKJcah/UKq ek4xvL6WsOo58cJ14q4yHjcPZiE54sI6aUFI1nc88pTQDPdSHAHo1jA/7+lXy/WPJcXy e42w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NlG1g9cn; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la8-20020a170907780800b007820e1a4302si1298699ejc.675.2022.11.11.01.41.42; Fri, 11 Nov 2022 01:42:04 -0800 (PST) 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=@intel.com header.s=Intel header.b=NlG1g9cn; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233288AbiKKJNb (ORCPT + 92 others); Fri, 11 Nov 2022 04:13:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233237AbiKKJN3 (ORCPT ); Fri, 11 Nov 2022 04:13:29 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD63AC12; Fri, 11 Nov 2022 01:13:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668158007; x=1699694007; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=IVJlEJxcaLZjgj4B1SoJxrWJYgVgR68jgWpjx2f8kP0=; b=NlG1g9cn7mh4brWCgNfFZUyUSFPK1vYJPt/oH6vUDlLx+Xwzy4ymxdaf VBCC47YUfLEtH8Gp+Q2e+u1f+UlrALuvPloyd8PVFK7QSxfYsBQ7wFp5n FY/Q8rrHAZgGnhYgu5kmnSETfWTZPh1cjSsT4BsFevjVU+knAN9wwzW/H QVrt/7JcHilTAqFNJlKfvYJrC2uutgHowEt3FXfeSWeugwp9k0hR248Mw YGjcf0nipbMfAx5ws2nVgfQ09pGTyc+dLyjzU/XIc7ANkCcSscdMVot2r 57cP4Vypkn5EzL8/gU3IXK92+qUTBF51doxpcf5wKCdQndOBa+YJHyyk9 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="312709452" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="312709452" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 01:13:24 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="706488000" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="706488000" Received: from ldunne-mobl.ger.corp.intel.com (HELO localhost) ([10.252.15.227]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2022 01:13:19 -0800 From: Jani Nikula To: coverity-bot , Lyude Paul Cc: Thomas Zimmermann , linux-kernel@vger.kernel.org, Ilia Mirkin , Daniel Vetter , Karol Herbst , Ben Skeggs , David Airlie , "Nathan E. Egge" , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, Dave Airlie , "Gustavo A. R. Silva" , linux-next@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: Coverity: nouveau_dp_irq(): Null pointer dereferences In-Reply-To: <202211100850.7A8DD75@keescook> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <202211100850.7A8DD75@keescook> Date: Fri, 11 Nov 2022 11:13:17 +0200 Message-ID: <87iljl6ehe.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 Thu, 10 Nov 2022, coverity-bot wrote: > Hello! > > This is an experimental semi-automated report about issues detected by > Coverity from a scan of next-20221110 as part of the linux-next scan project: > https://scan.coverity.com/projects/linux-next-weekly-scan > > You're getting this email because you were associated with the identified > lines of code (noted below) that were touched by commits: > > Mon Aug 31 19:10:08 2020 -0400 > a0922278f83e ("drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD handling") Hi Kees, this looks like a good idea, but maybe double check the Cc list generation? I was Cc'd on four mails today that I thought were irrelevant to me. Thanks, Jani. > > Coverity reported the following: > > *** CID 1527266: Null pointer dereferences (REVERSE_INULL) > drivers/gpu/drm/nouveau/nouveau_dp.c:237 in nouveau_dp_irq() > 231 struct nouveau_encoder *outp = find_encoder(connector, DCB_OUTPUT_DP); > 232 struct nouveau_drm *drm = nouveau_drm(outp->base.base.dev); > 233 struct nv50_mstm *mstm; > 234 u64 hpd = 0; > 235 int ret; > 236 > vvv CID 1527266: Null pointer dereferences (REVERSE_INULL) > vvv Null-checking "outp" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. > 237 if (!outp) > 238 return; > 239 > 240 mstm = outp->dp.mstm; > 241 NV_DEBUG(drm, "service %s\n", connector->name); > 242 > > If this is a false positive, please let us know so we can mark it as > such, or teach the Coverity rules to be smarter. If not, please make > sure fixes get into linux-next. :) For patches fixing this, please > include these lines (but double-check the "Fixes" first): > > Reported-by: coverity-bot > Addresses-Coverity-ID: 1527266 ("Null pointer dereferences") > Fixes: a0922278f83e ("drm/nouveau/kms/nv50-: Refactor and cleanup DP HPD handling") > > Thanks for your attention! -- Jani Nikula, Intel Open Source Graphics Center