Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp859164pxb; Wed, 6 Apr 2022 02:15:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxViDtuAu4Dh1fH6+ffJvWDrn0FFOz7Vf4pfwkMWGJqh4TgHrNNcwq6Xe5xK2S0TnQslRSd X-Received: by 2002:a17:90b:3b8c:b0:1c6:eb72:24b4 with SMTP id pc12-20020a17090b3b8c00b001c6eb7224b4mr8792983pjb.171.1649236505529; Wed, 06 Apr 2022 02:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649236505; cv=none; d=google.com; s=arc-20160816; b=smSphitri9VVFuvBJ1brvi7kafkMvAg3xp2VcP+hlSbAtqnNypQIhkcx2Itiaa6369 PTVkkUKkg2wG2hJCd6vcyV4/cZloGjDIlcoO+9nnzsrvmp8JLyhoy4M23mCIB95fJtVB FlgK6euL3Af4itULXdiZeJOLwL0DdKRGkl+BH/6kdF2TuFzX3oDDqm40ho9T8gG3wt6+ jFzCjEb1YBAKExzYY1LgZBHIvvLZHGg4z0gQEUux+RC/LpQnmHcT78l6aKujaPF9Oh2G hh8xwVSz9dgd+hGy3uMyNLhhYgzgSCdhffpIgIhps0Wq0sNUC2aFfrUYvGtpWd07HMVf CI9A== 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=rMOsY3GQuFWBk7+5Z8cMJ1L8cjH22Caz7mxgtz59FeXglS/vBgTELzlGecJR3ni0eD WcpPBGnGOtQcy3faAtM90EOy0dtVb9i/jl79pevduRjW2SBhAHaab12GURUsO36qrE0S 6elfj2scrXNuvnENuwaKBCZ2MEq0JKeFsfo7rTOxksJh1pXWV0lpIyFzfoVYxuvMPXI7 FHmkEf3Wb6G56S1+rcYeY4OTTeA/ctYdApTfnzNvYGCd83D5TVHNr4XnG/3a4h7Gj5L/ DgAeYSVEDsqMR7vir3pIKDQzipGsjHN/FZWc8aGgvl6i6tQoT3WjGncN0mRHrCFDg7HZ M6IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlOylQ0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v34-20020a634662000000b00398ee6d6427si12671644pgk.335.2022.04.06.02.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 02:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AlOylQ0j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43D8554E459; Wed, 6 Apr 2022 01:04:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1389291AbiDEV7N (ORCPT + 99 others); Tue, 5 Apr 2022 17:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573250AbiDESdJ (ORCPT ); Tue, 5 Apr 2022 14:33:09 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2A913F81 for ; Tue, 5 Apr 2022 11:31:10 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id z12so24774334lfu.10 for ; Tue, 05 Apr 2022 11:31:10 -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=AlOylQ0jQKVcFM1G55vgGfIw3N7jIKcPb8Fyyp/oULoQtqlhNXFckkFd9+WqoIycaG j3uSXFSnN9MUKlSNkyQuzzYQaqjV8XGOAV98W2dX0/cu0rYAgesS6ZgugsjdK/H/2jkk fnbt8Gy5iVlTh1oKRiKygkFT2D7usXujbRj9wtNhFNlx0xb1yHFF5nZCSug2Yffskd6k SQbOTL8qdWillxUg7Hfyk1Z4yt900US5/buZ6HSUAnvFJUJzW3ZTTDpX+yeyxCzbWSFK f/y1ax+r51kD23D/27l7CsWDA8dkGaWmjrSo4eFHKK9DHWERyMZIp7K7VdiMTWXaCd66 t7Sw== 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=buQahpw01XwzxpClucWcNEWCeBLnkS4lpP65I31PbvejS2LZ2sSEkT547PL6RIDKqx VLlw/c0LN6EUoukge228Ubziag6eFpGLx4YnfTYNhXTRibHwSd/xlQ1kXJBURmbPxaAg 2/aj2rYSDP51FxKtQxJpDeh+nskoJD9VQUuNlSSIUJSWfUFIC2YRSO7A2oNoPe3tP5M5 R7YwFu8YmY7vGG5wk3FmYO8AH/yla/1CWWBe963zuU/iE75KaALbU9WJ9Dyz2riazRIu EKMRGFcoSIeQ3DAcD3bjjKdVQUZj0WQ93WuVN5t3ICOJG1dRAsFQClKNUqpQ5jjCLFED suzA== X-Gm-Message-State: AOAM531QXaTsZlhsORrmGr8a9IVgKN+ckFH2jTQ2Y4I0IXxziqP6jRjA urPesaDuR14wBkwttLDq2BahSA9KG63Bmw== X-Received: by 2002:a05:6512:2347:b0:44a:6e3f:74f7 with SMTP id p7-20020a056512234700b0044a6e3f74f7mr3457813lfu.660.1649183468960; Tue, 05 Apr 2022 11:31:08 -0700 (PDT) Received: from noname.. ([2a02:2698:8c2a:226e:6d9:f5ff:fecb:a8ab]) by smtp.googlemail.com with ESMTPSA id c5-20020a2e9d85000000b0024b1571209csm800133ljj.0.2022.04.05.11.31.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 11:31: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] drm/amdgpu: Accessing to a null pointer Date: Tue, 5 Apr 2022 21:30:19 +0300 Message-Id: <20220405183020.9422-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