Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp350301imn; Wed, 27 Jul 2022 08:01:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uFmVJMylO6xZHhu5qBAFuDvdnuWykqNHUbeMwjrhEE1o68n2/aV7VK32Z8f9xhy0zTsfYt X-Received: by 2002:a05:6402:278c:b0:43a:91cb:c43a with SMTP id b12-20020a056402278c00b0043a91cbc43amr23547644ede.188.1658934066157; Wed, 27 Jul 2022 08:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658934066; cv=none; d=google.com; s=arc-20160816; b=0bPznwPrjYtLMZFgGEXOcfnYNJFmf1OdCPYF6Qm3NFoBgm3GlhTsQLkBf6HrW4L7dz II+DhYV37FPd0kK39qI701EIeCh0F3Y/+vbd3DV+GS7xSeYE1ix6rtt5flhvnfSBr4KN z8E67H1p/ovZyze8KXP+2NTy0KT69MzTfkuRej2hDmpf1AehUT1jRpitSH2iFejGMjmP y11+x/p81q/TUYTLQVkptsGr+v6HFj5vW2ac83w/SdS5zxDmSYH3UnfkWv5JJoUac2md TP/TRe3pr09N0SF7rZvfItHufpxQPbLdrWrM2zeQfWK+3zabfA1ffQmZvEuowkbxuBBe gnlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WrAxAwQvWkNvn9iTR8AvgTpHQwZ7heaV6m22/yIWhK0=; b=fiEfHhcnkXPminQj57XYfyRq/3T0bR7XzJ49/XFlwabEejE/+gojh6fjBLzdCbZmWy GVNHrZorCqc7w1jzqQqd0hux4Lqfg3yqlE5j8DctfhNf75FWJmtcXx/6rx9rEJUVOoDt vZuoawaMEsRJHbhUneNCjNoeGTjypnBLRPq46OadvHMaXXccZMTK/HdTGzTwbExcn38B WuH/ZOBKO8VVMOL72QsQ3Bq02JyExG94vceG2gl+wI8pTQejKW8yksJN0IUtyvPW9D6x 7Ydd3lBoHLXdh10ULto/3QiBWUACV6GXHi7qfVAYRcsP3ha34nw4x3YSpFDkNfMerXHC yS6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Q0T1JN9h; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz3-20020a1709072ce300b00711988b5919si21247062ejc.810.2022.07.27.08.00.35; Wed, 27 Jul 2022 08:01:06 -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=@gmail.com header.s=20210112 header.b=Q0T1JN9h; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234124AbiG0Oz1 (ORCPT + 99 others); Wed, 27 Jul 2022 10:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231748AbiG0Oz0 (ORCPT ); Wed, 27 Jul 2022 10:55:26 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 893D3659A for ; Wed, 27 Jul 2022 07:55:25 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id m8so21702886edd.9 for ; Wed, 27 Jul 2022 07:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WrAxAwQvWkNvn9iTR8AvgTpHQwZ7heaV6m22/yIWhK0=; b=Q0T1JN9hd9Oi1QPMQUOoi3FKjamneDsM2FMlfalCMAcLaxJrnG/um/ftBNacBz+jY4 1VD4bzLO2cYhyiAQ0hGYxcoEmPSbJw6SoOE4DzNGODp0C92jX+77TLJ37R6bT5uUKkZh VdmRqYiGh/Ghe070Tad3H67U+plMcZ3BBjwC7GZDNnyv4ycuy7hZoq0IMRGOeYVqm1bm VuQCxIUUP9aa7EQCyOA1tXxfxUw/VbPmbo/415UyjDE6Y8XBXRbvEUS8whW4nG3sf684 a3lKhKnVEoTlndTbusm9wbRzg0wgziQ1lnW1C+cSOzyggWIV4QjrcHzuZ1XSSSbG8CRB 3FJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WrAxAwQvWkNvn9iTR8AvgTpHQwZ7heaV6m22/yIWhK0=; b=PYbdBg1KPbiX16E//Hha4taubGK1ZpAAj5lzH67CkqH32p8toG+Olq2v+bENhrrsc2 JRrV1cF/klWESmzuZUkbtcA/TYJDJVzau2339se0zdhH5QJK8B2TElTqWCvbIrtFPIMI JvrGYf0gJR1tScede/Po+4XHbqAaMydyybeJAMtj0CxNsCVSs5fAxPubhhT9mbAqKVT4 bHdASyg08nExwMa6WNcyjdRx+MpW+CrRQtwwvd6mEFPMEFXY+CNw+xCcW0RwP112zvTy Hq7TvgDpp4VuBvdxFevA4z7KHyy/8wP+anFU0tb8xuwqWBGhKMXmjc5mAJU5rDJDmWUY fLWw== X-Gm-Message-State: AJIora9KLNfjDEkkq4HtAHJJLjq7bVBUSejL4MRAosPI+I8l+b1IrT0J yPPW5Oknmqroyb6EHTlv079ZXUsBPCn1byxNGoQ= X-Received: by 2002:a05:6402:500e:b0:43b:6f0:756b with SMTP id p14-20020a056402500e00b0043b06f0756bmr24034075eda.221.1658933724075; Wed, 27 Jul 2022 07:55:24 -0700 (PDT) MIME-Version: 1.0 References: <20220727144249.415228-1-Vijendar.Mukunda@amd.com> In-Reply-To: <20220727144249.415228-1-Vijendar.Mukunda@amd.com> From: Alex Deucher Date: Wed, 27 Jul 2022 10:55:12 -0400 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix i2s_pdata out of bound array access To: Vijendar Mukunda Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Sunil-kumar.Dommati@amd.com, David Airlie , "Pan, Xinhui" , open list , Daniel Vetter , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , dan.carpenter@oracle.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Wed, Jul 27, 2022 at 10:42 AM Vijendar Mukunda wrote: > > Fixed following Smatch static checker warning: > > drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:393 acp_hw_init() > error: buffer overflow 'i2s_pdata' 3 <= 3 > drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c:396 acp_hw_init() > error: buffer overflow 'i2s_pdata' 3 <= 3 > > Reported-by: Dan Carpenter > Signed-off-by: Vijendar Mukunda > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c > index bcc7ee02e0fc..6d72355ac492 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c > @@ -390,14 +390,6 @@ static int acp_hw_init(void *handle) > i2s_pdata[2].i2s_reg_comp1 = ACP_BT_COMP1_REG_OFFSET; > i2s_pdata[2].i2s_reg_comp2 = ACP_BT_COMP2_REG_OFFSET; > > - i2s_pdata[3].quirks = DW_I2S_QUIRK_COMP_REG_OFFSET; > - switch (adev->asic_type) { > - case CHIP_STONEY: > - i2s_pdata[3].quirks |= DW_I2S_QUIRK_16BIT_IDX_OVERRIDE; > - break; > - default: > - break; > - } Is this actually not used or should we just increase the allocation size? Alex > adev->acp.acp_res[0].name = "acp2x_dma"; > adev->acp.acp_res[0].flags = IORESOURCE_MEM; > adev->acp.acp_res[0].start = acp_base; > -- > 2.25.1 >