Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2562797pxk; Mon, 14 Sep 2020 17:36:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpzLRKKEl9SNadpiIcVdNaJOs6HnnYQH2lK9J/mmU2RdZ7CdqjpG0Gqij8f9hGHpLSdLhl X-Received: by 2002:a17:906:dbf5:: with SMTP id yd21mr17025476ejb.521.1600130176519; Mon, 14 Sep 2020 17:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600130176; cv=none; d=google.com; s=arc-20160816; b=XnaBN5A4t48lBAso9a/cMaUmCMvZWJ/s7e01qeewa2Pl7ZIBvTjztRNLa6q0wKvO5U JRNxKjRkkspdvMdUJUtsrz3tGQ5iZg1AaX1s8PSqAeOg4RUqemLmcqbE9F939GUbYntl Q7RauXN4vkwBj9q6ZOE8tP1bTvO4ZTzHrzMsp9faLPRqA7WtExvbnIndNo/KyKwNjyA8 Af/F0kDE9R25iJqYR4o2xpp9d81G2VY2v2kJ1WeRhACh0KP1Mps3UUC0U46d+HwrtpVh SZAbCyLu9CCCLtF+rNxHpAfq06RoWGFMiSuFs6h22ycIlco4AFJ7VP1kBxwZC2nmXcsg Ro3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=AMXsdcZMtd3r1FAfIZIVxJFPK/4+jeZlRHiiC+6VWdk=; b=ku5/le+k7JEeUOJtzzs+nU6ZI1oZ4WfC6MVZb/alS9Ss02O1+N84N3mgK3/I6z8D5f KwR+6AdP+mxul2OmifeO3vkimEtgRp4mBiNMKWuwa7j/BmPSEflSCiQ/3HHCFb+elRFv Rvj4aQ/V3K6370DECD8TL+J/4qmvlhjG1JoESJU520g0MCcf1LN6/qg7dnCZCt/U7gir dEJfE9lMEOBew7FylZAmdvxYzMqHTfvlubMaqjz1osUxDbf4cb/ZTfRo6S0HF6TDbzth Q29DrTaKpveZ5J6/0UsG9IX5rtLFj/4xqI6AUFJtiefYuImFAhapxE00J7mFraP+MAaY WNoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ROVNsuRW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si6275346ejh.440.2020.09.14.17.35.54; Mon, 14 Sep 2020 17:36:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ROVNsuRW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726133AbgIOAeP (ORCPT + 99 others); Mon, 14 Sep 2020 20:34:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgIOAeL (ORCPT ); Mon, 14 Sep 2020 20:34:11 -0400 Received: from mail-qv1-xf43.google.com (mail-qv1-xf43.google.com [IPv6:2607:f8b0:4864:20::f43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05B05C061788 for ; Mon, 14 Sep 2020 17:34:09 -0700 (PDT) Received: by mail-qv1-xf43.google.com with SMTP id z18so944085qvp.6 for ; Mon, 14 Sep 2020 17:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AMXsdcZMtd3r1FAfIZIVxJFPK/4+jeZlRHiiC+6VWdk=; b=ROVNsuRWiqNko5m4zp2frC9gpRSRjLNxQ2XVgBVyG7ZkgUHlYq2dfKhGAeTtqctAla T568uN4UtbeHz76/tSras7chrithr6p88yF4RpgN3Q5nrJVVsGqiCGWqcm2FHUC4ta7Z 174HVWM7lKsoqMexzIvdMIYs2bLddMlpwr/TjHY053jSn83tRqpJfrcUh5/bbmFP5aAQ fk/wzSCnysKVOGZiEo2cgmDUhClOP8PXnQ4QxL8Aw7Wd8WeQW7BES/E0HDW8PEXSQXqI j2BSAzT+lMR+cb1wLOgtTRPNUCLT6+vsI/vQGjWIXmi1B1McVe+p3pbLQwl38nLxu8AC M1Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AMXsdcZMtd3r1FAfIZIVxJFPK/4+jeZlRHiiC+6VWdk=; b=AVI268lj6pZ1nNgZvfk6+tEDhHFyfiUGciaFv+xr0blZXVddd3XYXVikXarpjAoG19 K9DXLLUQ4zFbfDI2NRDLNPHv61ryYkFjzp4pa5RU4lReAqZSjFwaMhiKM2tO4yjEqqKW I2KFI4RDFQpJkjOChFCU44hchqTWziAWKmMg+pB9BJO4mH99cPbuNvE/ok2yOYbDkatD 8uZH5KcrQYqVgcUehji24iiHLO20sGVc1ewT0W2zv+z0vBcybQb+ZZEswoxQXmIlP9BU 9vbhVFzy4V3CauZs+tqXADQlYZdoTXSKqpSTDkNOPmUsm9t0AXDyxNaeiIf7ESyodMiL XFTw== X-Gm-Message-State: AOAM530mpZRjRujcVONwZ8zv+vMnbbYZWZhHB6aPjgZkFb0Xtgwb3jMx Kq5WVZO6rApB1pZ1hZ6A1fqyyw== X-Received: by 2002:a0c:9142:: with SMTP id q60mr16094189qvq.13.1600130049049; Mon, 14 Sep 2020 17:34:09 -0700 (PDT) Received: from uller (ec2-34-197-84-77.compute-1.amazonaws.com. [34.197.84.77]) by smtp.gmail.com with ESMTPSA id c13sm14830849qtq.5.2020.09.14.17.34.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 17:34:08 -0700 (PDT) Date: Tue, 15 Sep 2020 00:34:06 +0000 From: Bjorn Andersson To: Zhenzhong Duan Cc: linux-kernel@vger.kernel.org, robdclark@gmail.com, sean@poorly.run, airlied@linux.ie, daniel@ffwll.ch, smasetty@codeaurora.org, jcrouse@codeaurora.org, jonathan@marek.ca, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: Re: [PATCH] drm/msm/a6xx: fix a potential overflow issue Message-ID: <20200915003406.GC471@uller> References: <20200912102558.656-1-zhenzhong.duan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200912102558.656-1-zhenzhong.duan@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 12 Sep 10:25 UTC 2020, Zhenzhong Duan wrote: > It's allocating an array of a6xx_gpu_state_obj structure rathor than > its pointers. > > This patch fix it. > Reviewed-by: Bjorn Andersson > Signed-off-by: Zhenzhong Duan > --- > drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > index b12f5b4..e9ede19 100644 > --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c > @@ -875,7 +875,7 @@ static void a6xx_get_indexed_registers(struct msm_gpu *gpu, > int i; > > a6xx_state->indexed_regs = state_kcalloc(a6xx_state, count, > - sizeof(a6xx_state->indexed_regs)); > + sizeof(*a6xx_state->indexed_regs)); > if (!a6xx_state->indexed_regs) > return; > > -- > 1.8.3.1 >