Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4009326pxj; Tue, 15 Jun 2021 13:24:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnYiBdNfn45fO/G6wkXKsNLPaWnIpGuPnqytQH49rGpnnVt2RK0M9qo59V2n3jWpo9wDna X-Received: by 2002:a17:906:4e05:: with SMTP id z5mr1459988eju.520.1623788647375; Tue, 15 Jun 2021 13:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623788647; cv=none; d=google.com; s=arc-20160816; b=qeGQbEv2I4trlfw4JyGJFF7velXuZq5Z0h4weVpq4Mi8QO9u/0hdpHOta0uLb6WZuh s75ysFFihNQk4kkrt8WStl60A2zk3B88zu+SNLF772cjH5v2TWv1hjlvqAJd0MMq8mj2 U68cCGLNWH/JGsqqbAhp+WTeog0PThOqdXHNPn17CGpHl46swh1Vnjrl+Q0CvZds4t6x hyKEHqwr+OmEpS0ZyBczCBSfKw4zYQeyGAUU3v3SP/4XI0GFS0WcVmMPtY4WQeOfpzQh qgnWVAe9/U+FJZ+/uG7vOGejQbgV7I3NHm+Vesr+389WVOttGJnWzue1Hy6xfRrokv26 Uc2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=HmeE2bFqEPYooaRCQe+mmTIh+tQy90b/jOiNc6N0zCw=; b=uM3abL56pJx3v9jK5BhgS0q/bu67RsQnC8Hu8fta36BNNP/urOcVKM/WD3MpFf8XDG 9i+Z2iSG+KO+smVpxvT0LIygFTR2tAg3FWfBv8ap3ZhPFP2an/9Tn6uHf1ss33YAXI/W QWipTmAdVt+6hnAp1cQA3PszQPVzzlYf8K2tQYytwm882A6PjD+l5nk0zL9bQ7Y/D6rq NKsIG9IGHMEFeJuqFYezaJiNwob4YBEwpjEI4pkijGJvc29w8OuxPluXymHsjMuRv94N NuBxIjgNAOtvy0tQHd/bd/0hecUWGe8v/k9B1Kvku8sJL+cuo656Pj3QXV0XQ3jtjySw r+Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=ic0RGkXG; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i19si15350310edv.349.2021.06.15.13.23.38; Tue, 15 Jun 2021 13:24:07 -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=@mg.codeaurora.org header.s=smtp header.b=ic0RGkXG; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230466AbhFOUXY (ORCPT + 99 others); Tue, 15 Jun 2021 16:23:24 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:13955 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230371AbhFOUXX (ORCPT ); Tue, 15 Jun 2021 16:23:23 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1623788479; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=HmeE2bFqEPYooaRCQe+mmTIh+tQy90b/jOiNc6N0zCw=; b=ic0RGkXGmGi4W6CRSx9CLY/tbRe9FEykeI9TJ/r9FN49AXFHQKqAxYits71tX+roEw1jk15X KeIwfIL0+SnP4mXyG7pqZ+lJI8e6A1arexXCl8m4vsfACg3zE6N7+EqL+O7oTrofjMILZ4BS QQolWvPOEX1bQq6FGlL7+rbPXBQ= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-east-1.postgun.com with SMTP id 60c90bbae27c0cc77f9e1cb1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 15 Jun 2021 20:21:14 GMT Sender: sidgup=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id AF2DEC4338A; Tue, 15 Jun 2021 20:21:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.1.10] (cpe-75-83-25-192.socal.res.rr.com [75.83.25.192]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: sidgup) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5BC6BC4338A; Tue, 15 Jun 2021 20:21:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5BC6BC4338A Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=sidgup@codeaurora.org Subject: Re: [PATCH v4 4/4] remoteproc: core: Cleanup device in case of failure To: Greg KH Cc: bjorn.andersson@linaro.org, ohad@wizery.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, psodagud@codeaurora.org, stable@vger.kernel.org References: <1623783824-13395-1-git-send-email-sidgup@codeaurora.org> <1623783824-13395-5-git-send-email-sidgup@codeaurora.org> From: Siddharth Gupta Message-ID: <75ce2563-3d34-a578-200d-8ec5f259d405@codeaurora.org> Date: Tue, 15 Jun 2021 13:21:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/2021 12:06 PM, Greg KH wrote: > On Tue, Jun 15, 2021 at 12:03:44PM -0700, Siddharth Gupta wrote: >> When a failure occurs in rproc_add() it returns an error, but does >> not cleanup after itself. This change adds the failure path in such >> cases. >> >> Signed-off-by: Siddharth Gupta >> Cc: stable@vger.kernel.org >> --- >> drivers/remoteproc/remoteproc_core.c | 15 ++++++++++++--- >> 1 file changed, 12 insertions(+), 3 deletions(-) > Why is this needed for stable kernels? And again, a Fixes: tag? Patch 2 and patch 3 are leading up to fix rproc_add() in case of a failure. This means we'll have errors with use after free unless we call device_del() or cdev_del(), also the sysfs and devtempfs nodes will also not be removed. Thanks, Sid