From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11843C43461 for ; Fri, 11 Sep 2020 18:00:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7BB4A2073E for ; Fri, 11 Sep 2020 18:00:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jmgA6ljS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="FX539b1S" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BB4A2073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=t2dgHAhA4dA+jbGczU8aVHVvoQRlpW6v4ns1kte97rQ=; b=jmgA6ljSXYBR3iKQ6XSpPOthS OYL08TkMUpaMtmLX+xHyE/kDBq2qnCiUkmXxeqbD4zaAnsRBm6FhHTm4mKm0TTlg2Qy1sFbDGFLk/ wSTMsD2hnTOvNhrD1VSUEgs+/UckkZAaJB4iLh9jkefYZJ0nSdCcqh4cDSwGj7z6bEo+353GcDcR2 c0Rdio9IQ7l3TPkUq84IMnGbsqXdssPUq19E0n6cGg6UfswUSLMJZdTHH6WOQF2Nh99eUna5AKtNJ 2glUg1TDiomhVrsEtLSBEEwo4+cnCNM0gCtfbthHDEHap+8KPBy7rCcwGtD/HGDUwcBTikH6zn5Bx 9p17bH95g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGnKZ-0000X2-J7; Fri, 11 Sep 2020 17:59:27 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGnKW-0000V3-N1 for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 17:59:25 +0000 Received: by mail-pf1-x443.google.com with SMTP id d6so7948422pfn.9 for ; Fri, 11 Sep 2020 10:59:24 -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=TXquo1qLqqSIdjE0lSTLkND6jkViwwDG0wLUjG4hQcI=; b=FX539b1S/fSYmDlIVIRft7aJLXtUq/mchMLXO6XDtcqcFWUpD06dPlhj5WeKoihPFO P/ZvP3e+T6Qs5KUSWymZ0LXg+uCOpKHhgni1Mgad0dMfin1IJ8wVTdEa4lfm6RnyABt1 mtL3RPZCZfcX0v19Q/kr+mvgicw6smWJMI4VxjInJvtZjPq5ZBMdpz2v+TsZRfuux2LT KzA5PBtqYGfeMtMPyh4HUU0tiiAcJNT9hxifz+Q7CkaltRYlNpbDA0e08Q9ny437lge7 KCKfWJFsjLvYwJEUrGKxXCWSEABvAKtezmJUlMIwrPCA/NGdh2qrH/CsJysdM7VnZcLx SARw== 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=TXquo1qLqqSIdjE0lSTLkND6jkViwwDG0wLUjG4hQcI=; b=hkEz5cEJiu8IV+PWeLDCQ4T2S2USKd/EvA21E9wdK5Y3b5WWivXsRK5gXxnSPrjPaN DAfW7pkmllP5TZhkdYlqvuntfuqCtr/ssgnQ3L4/gpIxnE4IHnqRupfvuvQRAzSOXy3t lFi/+EpWDEv/AjN03pLtpRyu/5Cc+H7DswSwx84RV4CvujlP8tVze4Cr1lPKsFSmG7EN QkxBlX0tcGkKPeJAN0GW0r7FP13zGDpG2WextAZQH6i0JMTfpjlyREm8/riw4T3hCJKz M2w/BIOiWgiq7ybmNmoTPHRSMxaIRC+R4QhPl6yY4je7Q0xMnNtYZ83Bw39mL+lipo3R 3plQ== X-Gm-Message-State: AOAM532ArdJIQXdbLStXOuIgQrs1NvrKzzXuae0QlFBcoT00h/IseJXC jH0k30xLXcVfjmGjsY0UnAD1sA== X-Google-Smtp-Source: ABdhPJzuoVoQsZf/X3umP/oy+to3uZXSK1m/Mwcq0DPLfv9Rz/eL3/ebVAOLbn32TZtgQs8qrHl74A== X-Received: by 2002:a62:8607:0:b029:13c:1611:6593 with SMTP id x7-20020a6286070000b029013c16116593mr3022517pfd.16.1599847162307; Fri, 11 Sep 2020 10:59:22 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id np1sm2430537pjb.2.2020.09.11.10.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2020 10:59:21 -0700 (PDT) Date: Fri, 11 Sep 2020 11:59:19 -0600 From: Mathieu Poirier To: Qi Liu Subject: Re: [PATCH] coresight: Don't allocate pdata->conns when there is no output port Message-ID: <20200911175919.GC613136@xps15> References: <1599550288-41724-1-git-send-email-liuqi115@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1599550288-41724-1-git-send-email-liuqi115@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_135925_030412_9B093555 X-CRM114-Status: GOOD ( 21.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxarm@huawei.com, Al.Grant@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Liu, On Tue, Sep 08, 2020 at 03:31:28PM +0800, Qi Liu wrote: > When there is no output port, coresight_alloc_conns() still do the following > copy connection information to pdata->conns, and this may cause kernel panic. > Let's fix it. Function coresight_alloc_conns() doesn't copy connection information. Moreover sink devices don't have an output port and this code has been stable for years now. As such I am suspecting that something else is going wrong... Can you give more details about the coresight topology you are working with? An output of the kernel panic you are seeing would also be much appreciated. Thanks, Mathieu > > Signed-off-by: Qi Liu > --- > drivers/hwtracing/coresight/coresight-platform.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-platform.c b/drivers/hwtracing/coresight/coresight-platform.c > index bfd4423..cdc8824 100644 > --- a/drivers/hwtracing/coresight/coresight-platform.c > +++ b/drivers/hwtracing/coresight/coresight-platform.c > @@ -26,12 +26,13 @@ > static int coresight_alloc_conns(struct device *dev, > struct coresight_platform_data *pdata) > { > - if (pdata->nr_outport) { > - pdata->conns = devm_kcalloc(dev, pdata->nr_outport, > - sizeof(*pdata->conns), GFP_KERNEL); > - if (!pdata->conns) > - return -ENOMEM; > - } > + if (!pdata->nr_outport) > + return -ENOMEM; > + > + pdata->conns = devm_kcalloc(dev, pdata->nr_outport, > + sizeof(*pdata->conns), GFP_KERNEL); > + if (!pdata->conns) > + return -ENOMEM; > > return 0; > } > -- > 2.8.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel