Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp920836imp; Thu, 21 Feb 2019 14:10:10 -0800 (PST) X-Google-Smtp-Source: AHgI3IbQnnZzofz/u9WKdtLruckx2NNzzEaKd3wKiW95PkN2sZlsxbBr62ykSSL9y0nJdYvJ47qE X-Received: by 2002:a63:aa46:: with SMTP id x6mr719774pgo.452.1550787010014; Thu, 21 Feb 2019 14:10:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550787010; cv=none; d=google.com; s=arc-20160816; b=ypLIhncTNr6kQqgZ481y/Jv9fH67JXpAsomrrPunBtVt0gvi9j34S80GqLjUgVGXFK wRVp7+Yy1CnlZ7u49oLA18moyCAFp3VXKNTy614Z+dai0q3c9uocr+Kt1Dy7Y8gDeALn OJycMkUbU0f/68Y7RKtUc7yCRJhzzohnZFHktub+M8hU9JvnYbud6PwSXN6yDP8J8Mq5 zepXcIKYfW85rIyItfnZ+WDie304HYC/AFc+U8zHda4QeX11/xJOw1IhkY4M4h3dwuan nSfgHl8a9LqXmF+GSzfx4DiUIpcXSRYL/SnjH1ffGjNzosV0RAa3aEYa+dLpbLb6DeRs usng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature:dkim-signature; bh=9Ld2EtjPwJJRl7Ega52DT+uYlZ44BRB+psdVDXSaUzk=; b=ZbdhLI2pW8ziNKCTI5yILUeB0q5Se6/3Zy5Ud0H1/RT6KBMpKJWyMWL4WGCqgA+DYj L8wufsVLPPWzmDosJH7AsdI9e7CJ/hD39Q7oLErbaiOgEfL13mDB4liXOawuuv3kkNiX TOmZkZ0FN3DuodQLU8jygDhIq+Kp16Qpef879jXWv4MddG1Rn5oI6mHiNm+XViR8Am+0 iSss0Xlo97eO9taju0ujM14d3MbCLg/PWXifINYOImEkFI1ci+rQhL9stXK9cYnUTSxV 10HmK+ggVbp2f9fRiS+fWJkAbLxQ+RX6fsZSaYCfPcKMgL0rGmoRkvioCXiXZ2iSqwNF tLhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EyyivkRQ; dkim=pass header.i=@codeaurora.org header.s=default header.b=aDeWi6bm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y26si49022pfd.25.2019.02.21.14.09.55; Thu, 21 Feb 2019 14:10:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=EyyivkRQ; dkim=pass header.i=@codeaurora.org header.s=default header.b=aDeWi6bm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726241AbfBUWIS (ORCPT + 99 others); Thu, 21 Feb 2019 17:08:18 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:34480 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbfBUWIS (ORCPT ); Thu, 21 Feb 2019 17:08:18 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1234660860; Thu, 21 Feb 2019 22:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550786897; bh=e5KGMfKYIXT5NG51pD6YJpEp4jVrgpBVmhvpNnqmRtQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=EyyivkRQH1EF4u8bFjZxbTzbmyjMJ4ya3dOa3QLKtbIqqrKSF2935fMfB8VqLfDfg OloJZd9I1wckdFdlHh/RA+TlrWMaKPJ3dzbR7aDxPQFEm/c581BdXp/Gx52hJcCA4B xNiXx4sfSivMOnZCEX35Kreh84sznTKdN+nfZp8o= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.60.81] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A93A360237; Thu, 21 Feb 2019 22:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550786896; bh=e5KGMfKYIXT5NG51pD6YJpEp4jVrgpBVmhvpNnqmRtQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=aDeWi6bm/Dl1plXV/yFL9ChuvPuQI0SZ0GkEiFzVHBY4ilaNVRc72gzhr3Kh/PSSM QopbpIgi+tnEPU84Ge1QBkbLTXTxnoRKHsNfbQUsYSDXs4rnkoKoBYl3TebjonfPKy 0+gDOzSh3qCILwH/zbQWzmO9JVcm3dBPabxME624= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A93A360237 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=jhugo@codeaurora.org Subject: Re: [PATCH] drm/msm: Fix incorrect struct size for memory allocation To: Jordan Crouse , freedreno@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, stable@vger.kernel.org, Sean Paul , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Rob Clark , David Airlie , Daniel Vetter References: <1550786069-18328-1-git-send-email-jcrouse@codeaurora.org> From: Jeffrey Hugo Message-ID: <8100608f-0f8b-7f67-bfa1-9f6c4de03fec@codeaurora.org> Date: Thu, 21 Feb 2019 15:08:15 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <1550786069-18328-1-git-send-email-jcrouse@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/21/2019 2:54 PM, Jordan Crouse wrote: > The allocation for the clock bulk data does a classic sizeof(pointer) > instead of sizeof(struct) so the array ends up incorrectly sized > for the clock data. > > Cc: stable@vger.kernel.org > Fixes: 8e54eea ("drm/msm: Add a helper function to parse clock names") > Signed-off-by: Jordan Crouse > --- > > drivers/gpu/drm/msm/msm_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c > index 906b2bb..31e1481 100644 > --- a/drivers/gpu/drm/msm/msm_drv.c > +++ b/drivers/gpu/drm/msm/msm_drv.c > @@ -96,7 +96,7 @@ int msm_clk_bulk_get(struct device *dev, struct clk_bulk_data **bulk) > if (count < 1) > return 0; > > - local = devm_kcalloc(dev, sizeof(struct clk_bulk_data *), > + local = devm_kcalloc(dev, sizeof(struct clk_bulk_data), > count, GFP_KERNEL); > if (!local) > return -ENOMEM; > Isn't msm_clk_bulk_get a duplication of devm_clk_bulk_get_all() ? Surely it would be better to just use that instead? -- Jeffrey Hugo Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.