Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6971175rwr; Tue, 25 Apr 2023 06:33:31 -0700 (PDT) X-Google-Smtp-Source: AKy350b6xudpBZ6/Qt6YoWA7MbPXI/Ccs6cGBGgnOspDtaCoO/M1H0SnbLccgJKkENXRQoXogn/N X-Received: by 2002:a05:6a21:788d:b0:dc:4369:16a4 with SMTP id bf13-20020a056a21788d00b000dc436916a4mr22458785pzc.19.1682429610741; Tue, 25 Apr 2023 06:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682429610; cv=none; d=google.com; s=arc-20160816; b=eHrYWdeTQl06Dvm71pzpr/45OPrLZeUD3xXRDKRu7tccm6BQJ2xyzACSwVjZDMvMBD +Ks5mZ4+2/YTQZycX5tcNe0euJlUhE/DTpMncb+NTjR9bGYNNR/tcHaKnjRymvKlS8aF qviTgSamrLPmbfRAq5zQAWWBW6To7Cn9h8ubfsgoZdtHV4PfWjaz24P8MV6La0fQBxYD eDs1/zphdCVDifMY3uBTMH/vCv5SbaGbDDHyOoEJEe0GMs2acK/bpzIyTP2LeefgciTi 34emMvwosMvL+PSrXMA+4sMoucl8LXajeYajJQ3U58+Gp8vUEHbZ96hAfPSkweZHykHm OBtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6mLOKeUOWE4BsNStMz/f3MVRKNrrhrR1bFq6OJ8aTg8=; b=iWYE6ukcxH5rLCnaFcf+ETj/KJxr7PlG2wmRK1/Q5NlPeOXJmqA/+tq4cxH/naL5c3 DQ6DSVw7+RBPB/CN0Ni3V8hAEZ1s92I1A9kvYaZ6NiX4g3fZlKx9Pfx3dOaIzyk09FQW j2oD6ubtNzz6gCDAtMGxUB0D/TzM6kEMNM1mWAzVpgfk866UagieicYPw80mHxMK6t10 sM1MT1qup07Oa54nTZK9jXUany7Oao56kbQcW7I37+wOPuo0e0AE5XEIxfYlzYz0LGn/ Hkfs40qB7Dz2LEiUafRDvzG4fR1MZyXkItYwrkkYMUZsSr8VjJaBVgAFDRLnLQdpVBhE 3rGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=st4p308K; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a63eb4f000000b0051f74820afdsi13715450pgk.782.2023.04.25.06.33.05; Tue, 25 Apr 2023 06:33:30 -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=@kernel.org header.s=k20201202 header.b=st4p308K; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234230AbjDYNb0 (ORCPT + 99 others); Tue, 25 Apr 2023 09:31:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234190AbjDYNbH (ORCPT ); Tue, 25 Apr 2023 09:31:07 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D2B214442 for ; Tue, 25 Apr 2023 06:31:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B169D62E87 for ; Tue, 25 Apr 2023 13:31:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 165D5C433A7 for ; Tue, 25 Apr 2023 13:31:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682429463; bh=wmID8emQw+is79zlL5AF9o/8qFWaAe9tV8o9bZxfmd8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=st4p308KBj30FGGNjBVlzWhIO3+6w06o6Z0nUOl7vDHpvIq64qY179xoM9DlVUMYg KbU2Dw/vcVEEdidJKz5pmPmtWgjrdS6skIeMOIxCdPPy11VrPQtfGswh7nEfBOGNDr NBTV25ZRmHCeUaND41NJqa65fyAKhTGNnKmyT7ykiNg6HKxxkOkFxsd+SEi+x4/zX2 7J+KVyR23DcfUPYsvOfe3GuTLc8syUBVNCCN/fE4uV9fG3jlTM+0wNyWMl8nE6Io0b slRZq52cOfYhFLEf5ScU/8prCZ7Hj8ghfoK2CS8xTo09HqPsFdR33ltHvx+ua1qmXI Rux0i8icNS1Fg== Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-63b60366047so4617227b3a.1 for ; Tue, 25 Apr 2023 06:31:03 -0700 (PDT) X-Gm-Message-State: AAQBX9ejAYREe6DW9d47DBlzY6kc05JnZle2ChNLyTyn6cYd/6eqd/yH pzntePscKgTTbLEUhM8D3TvWk06r6CpGnhDNlW+lsg== X-Received: by 2002:a05:6a20:3d94:b0:f3:6b70:2dd7 with SMTP id s20-20020a056a203d9400b000f36b702dd7mr12684872pzi.34.1682429462222; Tue, 25 Apr 2023 06:31:02 -0700 (PDT) MIME-Version: 1.0 References: <40c60719-4bfe-b1a4-ead7-724b84637f55@web.de> <1a11455f-ab57-dce0-1677-6beb8492a257@web.de> <14636275-4d26-d639-5f6e-293fc6d1c4c6@web.de> In-Reply-To: <14636275-4d26-d639-5f6e-293fc6d1c4c6@web.de> From: Robert Foss Date: Tue, 25 Apr 2023 15:30:51 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/bridge: it6505: Move a variable assignment behind a null pointer check in receive_timing_debugfs_show() To: Markus Elfring Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org, Allen Chen , Andrzej Hajda , AngeloGioacchino Del Regno , Daniel Vetter , David Airlie , Hermes Wu , Hsin-yi Wang , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Neil Armstrong , LKML , cocci@inria.fr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hey Markus, This patch seems to be a part of a series without being marked as such, this causes issues when importing this patch with maintainer tools like b4 which automatically pull in the entire series and not just the specific patch. Either label the patch as being part of a series ( [PATCH 1/XX] ), or submit it separately. On Sun, Apr 16, 2023 at 5:47=E2=80=AFPM Markus Elfring wrote: > > Date: Sun, 16 Apr 2023 17:30:46 +0200 > > The address of a data structure member was determined before > a corresponding null pointer check in the implementation of > the function =E2=80=9Creceive_timing_debugfs_show=E2=80=9D. > > Thus avoid the risk for undefined behaviour by moving the assignment > for the variable =E2=80=9Cvid=E2=80=9D behind the null pointer check. > > This issue was detected by using the Coccinelle software. > > Fixes: b5c84a9edcd418cd055becad6a22439e7c5e3bf8 ("drm/bridge: add it6505 = driver") > Signed-off-by: Markus Elfring The email in the Signed-off tag should match the email of the sender, which it doesn't. With the two above issues fixed, please add my r-b. Reviewed-by: Robert Foss > --- > drivers/gpu/drm/bridge/ite-it6505.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/bridge/ite-it6505.c b/drivers/gpu/drm/bridge= /ite-it6505.c > index abaf6e23775e..45f579c365e7 100644 > --- a/drivers/gpu/drm/bridge/ite-it6505.c > +++ b/drivers/gpu/drm/bridge/ite-it6505.c > @@ -3207,7 +3207,7 @@ static ssize_t receive_timing_debugfs_show(struct f= ile *file, char __user *buf, > size_t len, loff_t *ppos) > { > struct it6505 *it6505 =3D file->private_data; > - struct drm_display_mode *vid =3D &it6505->video_info; > + struct drm_display_mode *vid; > u8 read_buf[READ_BUFFER_SIZE]; > u8 *str =3D read_buf, *end =3D read_buf + READ_BUFFER_SIZE; > ssize_t ret, count; > @@ -3216,6 +3216,7 @@ static ssize_t receive_timing_debugfs_show(struct f= ile *file, char __user *buf, > return -ENODEV; > > it6505_calc_video_info(it6505); > + vid =3D &it6505->video_info; > str +=3D scnprintf(str, end - str, "---video timing---\n"); > str +=3D scnprintf(str, end - str, "PCLK:%d.%03dMHz\n", > vid->clock / 1000, vid->clock % 1000); > -- > 2.40.0 >