Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp917680pxb; Wed, 6 Apr 2022 04:14:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLXK4KEVmfpQAFOm5N85haPF50B3lAbvRS4MARSPuJRcyWm6uYHbOSsy6G9tdn3YNT0/SK X-Received: by 2002:a17:90a:3486:b0:1ca:c6a0:3f8f with SMTP id p6-20020a17090a348600b001cac6a03f8fmr9468030pjb.6.1649243649539; Wed, 06 Apr 2022 04:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649243649; cv=none; d=google.com; s=arc-20160816; b=F6gdJJyQylI3qGwPr4jGVHmvGug2Rwm9bgOvYaD7INdWtR59lXLqoZcrWGhTSCQ6kC Q9/0GRlR26MhdbVR6OJ29AkPF6GNForaiQ70UQUVkf0lIEbiMTPdY6W/KaBJhZ27mEkZ LDJN2UVxjX2JLbPIBIfAVFugVGsvH72y6btkdvvIK4JVaxhSFph+Kl9daCp0z55mz3eO WwvVntBqlRgLU9dvQM0Y/046qf0tkmedUk6WFaY1YLM8zEGt/48mKax4l+RxbykLEoF+ nDZBc9NzPB5UZkO72HUiD8QCAebCHUkvzxHu0e5asQXkB7d2/cJSyuNRLbcY7mJgLbrm oyBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=yax7P8EHkvsWnyvnaOpe3ZP8r2G7HKN+i3pXtBsfClM=; b=C0/IfJRHCJ6PquEItem2LUtG5EBXNh2+8zmOjolt2IKdqcWSyHKlscKOuKpiKqBE7Q c2WEf8iMrj4dtvsSi7hwNb+meFjB0vz1OpyKxA/4RHnQRmsS4jqUazEXn3q5ogu0hX+U ax1zKURF8GveSyEMAKLGq8PkMJNguuZ7+NShqMkNHOFy8KIp8P1wlhwxKo9JG6wjd940 rhDVSlHx2SgcPs1IzoroXNMFoVpgW3iVVwINObnN3ySJ3xAVDw8WtznpDUetNZbEPYr3 7NPZCcsS6WyzAHoxAZw/NvxlY8KaDrcbVAIS3z3vxxanHqjfulJ0f2hprFwSdJyNc3IL y5ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eX6mY5a8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id v7-20020a17090a898700b001caa43d9645si4437295pjn.95.2022.04.06.04.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 04:14:09 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eX6mY5a8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 81FF45D78A1; Wed, 6 Apr 2022 02:39:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389555AbiDEWBm (ORCPT + 99 others); Tue, 5 Apr 2022 18:01:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572973AbiDERiK (ORCPT ); Tue, 5 Apr 2022 13:38:10 -0400 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60027B8202 for ; Tue, 5 Apr 2022 10:36:11 -0700 (PDT) Received: by mail-lf1-x130.google.com with SMTP id m3so24486489lfj.11 for ; Tue, 05 Apr 2022 10:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yax7P8EHkvsWnyvnaOpe3ZP8r2G7HKN+i3pXtBsfClM=; b=eX6mY5a8lSH1hyqUbeznreGC7UTb6M0TABj5aCC7d1j7X8S5tKD7PEwqCQaBddz1/U WYtwfZYDDw/dYD4JRG69cicx99gRc3R8NnjE0szGGh5jJkHDDH5nlg7OI0bG7Kg8MvUt N+02SEESeCp662srZbhhQwqKi0sqlYTzC14XKEFwtf+XzOMQkJL0/ayQRgyL6zt44GOi 2WpLLgAmNUr9+ojdOcvdbvkIjm2clTL7i6syEiYxeCCrWBRdEoiNP34kFDSfWc2U4KKK FpMo3KNFr4Fb3z/FJBcbBLfeTTQjOep3Ufsp+c/ZStiy+0xbxfOQ5uPnPUdxYBkipNHr btyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yax7P8EHkvsWnyvnaOpe3ZP8r2G7HKN+i3pXtBsfClM=; b=p2b2g0Fh9hNjnxXgogdifcYQgBj5y+fUQ/moLTPXluu8HaYUMiuysL8NAeWBFy2CEa Zzt0s+XTwd2YQ+yeh7v5lcobf0Vqy+16bamR16bOjK+KhQvyZB5ChLawDvRxHTluQzB7 SqjyEFHLeTcWg/RyjtogV82ldRTKhvK6iuciMVZHIGpdZ3BtQ7QdeqXh/Y49ZepOj2+N /CpmLglg7fpzhPQRCOzTQFqemZWY66XHxrNxVBR6cECGNNt8wS0jMkZNyQLl8zj2NHvH chJQjWuc5ykASEyLyfsj7XUlmhp5LoEGHn4hSgISY3YiYtfy5epgR8v13Me4gcf5lfjR Pp+g== X-Gm-Message-State: AOAM530UlWuVDaw5Cu9egaXwI9SiknVBdwahIbh2BtBSaW9PJlppRFDT GjCIdJ7Tk8pHiEmS0SK/jC8= X-Received: by 2002:a05:6512:15a6:b0:44a:a117:f1d3 with SMTP id bp38-20020a05651215a600b0044aa117f1d3mr3461530lfb.216.1649180169117; Tue, 05 Apr 2022 10:36:09 -0700 (PDT) Received: from noname.. ([2a02:2698:8c2a:226e:6d9:f5ff:fecb:a8ab]) by smtp.googlemail.com with ESMTPSA id i33-20020a0565123e2100b00452f78ea43dsm481430lfv.297.2022.04.05.10.36.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 10:36:08 -0700 (PDT) From: Grigory Vasilyev To: Rodrigo Siqueira , Melissa Wen Cc: Grigory Vasilyev , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Jiawei Gu , Jani Nikula , Lucas De Marchi , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] drm/amdgpu: Accessing to a null pointer Date: Tue, 5 Apr 2022 20:36:12 +0300 Message-Id: <20220405173613.2611-1-h0tc0d3@gmail.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 A typo in the code. It was assumed that it was possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers/gpu/drm/amd/amdgpu/atom.c index e729973af3c9..be9d61bcb8ae 100644 --- a/drivers/gpu/drm/amd/amdgpu/atom.c +++ b/drivers/gpu/drm/amd/amdgpu/atom.c @@ -1426,7 +1426,7 @@ static void atom_get_vbios_pn(struct atom_context *ctx) if (*vbios_str == 0) { vbios_str = atom_find_str_in_rom(ctx, BIOS_ATOM_PREFIX, 3, 1024, 64); - if (vbios_str == NULL) + if (vbios_str != NULL) vbios_str += sizeof(BIOS_ATOM_PREFIX) - 1; } if (vbios_str != NULL && *vbios_str == 0) -- 2.35.1