Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1013589pxb; Wed, 6 Apr 2022 06:44:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2DeI+OKjbH1zFG5OzhYCZ+tlQ5olzPVLUlImFFzyz6eWV947wZONHYULF73JQ9KG96c0R X-Received: by 2002:a63:6446:0:b0:382:6aff:7bff with SMTP id y67-20020a636446000000b003826aff7bffmr7343479pgb.318.1649252645894; Wed, 06 Apr 2022 06:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649252645; cv=none; d=google.com; s=arc-20160816; b=pKRW08B0TI7ML0GQVB3wRj9d8NTiOgFk9rBDpEQbDQWWeT3kto9pbZDMcKQxaT6qZa azIjUOVbg5iB00dbyVuAWXZThWezRbq0pheOTgY1QUZPlHv8NQZl6W6dchhy6U8k4u0g Li0XfeYE4xm00wZVofIdP28729Hdaxn84mWGNvngAo7tstqc8r4fNZGnLXrzZ1J/nCoq maOKA29lJvUn9msaLUzx3JszQXaurFCGVlTzoOZiphOWmSrnxmVMCEJ1vpRlD3g/TCKl vHUa3fUqFiN7w8TKb7xCImPVg5nzFBgPuxo3tU9AZdv47nx268ZDfFStE3Z9pb8G2tF4 ANaw== 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=VPgCqm3dpVRlQZl4MLXIwKL2w7Ko5JLdXpBuKxjo+c6IH3TIAVk4zU8nqgGZSqjrKx HXuWUR3PaLrhDPgCWgwearO3zrn0teCF/nfSCG1wTRiBi9UB6/C3L+un2Crm8CFmlZKL ODNhD9yWET4I7kV+/o7zAHqHUCm3GC9ss6vgzRDszpQBQeuDiyPYzcR92+zi4TYHw0+j Zoeg3C2rW5hOVAei3aiSgAZrUpZRHPAnZflYKFiW1NAZmvn9IxNj/kVvRlqyiBXjK6aX YQVPYDmQcTE07/KlA5JI3C9HYxckUsvfBALXlj3p4lKa5tsY2MhalKYJKci8rcwZ9xOm wshw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ahjOaaJm; 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 b3-20020a63cf43000000b00398b6b8cdf4si16097959pgj.224.2022.04.06.06.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:44:05 -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=ahjOaaJm; 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F2B8E49DC7D; Wed, 6 Apr 2022 04:31:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1589097AbiDFASg (ORCPT + 99 others); Tue, 5 Apr 2022 20:18:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573225AbiDES0y (ORCPT ); Tue, 5 Apr 2022 14:26:54 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14578419A4 for ; Tue, 5 Apr 2022 11:24:56 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id p15so24754271lfk.8 for ; Tue, 05 Apr 2022 11:24:55 -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=ahjOaaJmEvTMuw04XfKy8Q/jCeHjGJeiKqvnNpxDiZbgbug2iTCIFR8Le7QuzbJ0sA woMR7Bdoa2OJ21AmrWpJ9wf5UeYzp2npgxgZT+buKF6ZPXRPo7D1odBGOr2gDXJBnEo1 dkWcurhuvdFNP8Dk650l2JhDA0fOvj008COWZUoCNgTJfeq4MP8RN6j7rsMKr8OLgz/g +REZDqGSM3Il7wPm+eIG3XRLQMRqOgjGT9K2/gEEyEEZPbgRlOUmBBozA2zAXYVf2nhK G8VsNSrxXA6MnMp6WQTrLd05UsiB5sx51uWWPhPAVm2lr97Bkt0pI2fpK8iXvhS5wgCO +jfw== 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=vd84ONRVKPWOLA2ybPVoXzrGNUrjp6dV6i9Q1P7pBfgQEqar/uOfRfTdCYf6cDDrNC NVBHu+2QfGe5nRYO96aga1OkZVPB6fk1UxutgqUfGKweW475LlwEPuSkIFisbVhdQ+Yb iHMeiRC7OV+gBJSSdMrOfU//ervUbR7G+qvl1CSajSz+ARXIbzfQGomhUL8n3WH3NbsN IDJGnTtPcWtGmILV64+O/r5VZ7pf/C8tRYOpwPeUy+NNn7H+OV+xKVdgRPD0WYFXtPyc kFoMRgGW1mPoSq2VRsVvgDDCrEs0TXz76xuIfZCVP/m/Nj17G9AVJkLddN6aQ8ur1rmq 1qjg== X-Gm-Message-State: AOAM530QYZYubzgDQIYjDaTl9V8VINs9aH0Rdg+8HhbBzIFDJ8XhfRmZ m/U5Rw68E4SFiXM2opIRbnY= X-Received: by 2002:a05:6512:3988:b0:44a:f02e:f28e with SMTP id j8-20020a056512398800b0044af02ef28emr3627503lfu.458.1649183094333; Tue, 05 Apr 2022 11:24:54 -0700 (PDT) Received: from noname.. ([2a02:2698:8c2a:226e:6d9:f5ff:fecb:a8ab]) by smtp.googlemail.com with ESMTPSA id bg19-20020a05651c0b9300b002497beec608sm1422452ljb.87.2022.04.05.11.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Apr 2022 11:24:53 -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 , Lucas De Marchi , Jani Nikula , 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:24:55 +0300 Message-Id: <20220405182456.8798-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