Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp408185ybk; Wed, 20 May 2020 02:44:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5BOnJabx0xs4GdWeWCyi4x8FMVD/stiZ7xuXh3pagEEnDHV9I09h+2MxgzXCVzfsBZUkf X-Received: by 2002:a17:906:49c7:: with SMTP id w7mr2952285ejv.216.1589967847426; Wed, 20 May 2020 02:44:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589967847; cv=none; d=google.com; s=arc-20160816; b=WITTRDV2lvX5NSIW9WG8xPd7uB045tLkaF034qR54ODUU3pJXMBLFoosj+8WSAQfbn N2uYndTMlEjv8EkW5SIdK4axwlaBhzCqYS6XYCv6LiMy6U5NgOIpCSuQhc2cdPw2zq3X qvcWWP9gbjODQwnijaTBHUsy+ygOvRdrv+ykO3ggM3x1zI7hTaNWaZeGAwfLSQrzPJ8q skHmNPXQn3Upk9WN46TAWLkqa2t51Z1o9epk9xa8meF2BMFZFV6tfno2hM/pmbtMmqlP FyR1UiPuCEelGrDi91g0E398vb6OhRSFn8I7I3CeVnBxQbu6Bj8KUuIccw5+AaGoPz2g y/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature; bh=QvCnssNRyOaZbTIUEafb9UtFFPJxVfsGVnlMsbWACNk=; b=Clf8FZb6fkb/jCDaESSGqCYMRAoGGXA426qpd8mRBK2QYRDVV1YFwY0CLAsfTKiytX 2bS9AKRW0d7Q93YNFNKBP6NNRRgg7L7BNAhzztyJu/6UITNt9o9QjPNDSIRUu2gR/e5E 8Vruhyzsm8jxMfxFHXfcvC3LTLeSPzR0+tkn68j4xwdC33GuVcDMQwxPWk+vJBtx1TtF El/IaT9+f2I1OBWCJGxMLoHBv7RmJD2tJ0y+X8/SvluYsWLRiamOkD7BmuSZQ3AawAMO n3oTkclODirXnrRurz61JH6DsYDkT6j2tO+XEd01qY0qp+e6FKRKLOjLIyIvnONmSac5 6t/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=hMWXYIFb; 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 g1si1389943ejf.546.2020.05.20.02.43.45; Wed, 20 May 2020 02:44: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=fail header.i=@mg.codeaurora.org header.s=smtp header.b=hMWXYIFb; 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 S1726851AbgETJkU (ORCPT + 99 others); Wed, 20 May 2020 05:40:20 -0400 Received: from mail27.static.mailgun.info ([104.130.122.27]:15335 "EHLO mail27.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbgETJkS (ORCPT ); Wed, 20 May 2020 05:40:18 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1589967618; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=QvCnssNRyOaZbTIUEafb9UtFFPJxVfsGVnlMsbWACNk=; b=hMWXYIFbJe1nR1v8vh2PtNIA3HL1RMO2UcdfPb2pB9+5KW5ecB1lnIL/MM0oYLG+i+OJNNWF 82CE8/lQ+rofaC5tjjKcmTt/5hYYaIzWqHkRJnav5jFcIT5+u5OeHPr3AcO9F7tauD60x5Zy PTs/ojEG5fQG5B9YCbC138jkJfc= X-Mailgun-Sending-Ip: 104.130.122.27 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 mxa.mailgun.org with ESMTP id 5ec4faf3.7fa94ab3d848-smtp-out-n03; Wed, 20 May 2020 09:40:03 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 976B0C433C8; Wed, 20 May 2020 09:40:02 +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=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=ham autolearn_force=no version=3.4.0 Received: from aneelaka-linux.qualcomm.com (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aneela) by smtp.codeaurora.org (Postfix) with ESMTPSA id E6D30C433C9; Wed, 20 May 2020 09:39:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E6D30C433C9 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=none smtp.mailfrom=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, sricharan@codeaurora.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V6 2/5] rpmsg: Guard against null endpoint ops in destroy Date: Wed, 20 May 2020 15:09:36 +0530 Message-Id: <1589967579-15559-3-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1589967579-15559-1-git-send-email-aneela@codeaurora.org> References: <1589967579-15559-1-git-send-email-aneela@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chris Lew In RPMSG GLINK the chrdev device will allocate an ept as part of the rpdev creation. This device will not register endpoint ops even though it has an allocated ept. Protect against the case where the device is being destroyed. Signed-off-by: Chris Lew Signed-off-by: Arun Kumar Neelakantam --- drivers/rpmsg/rpmsg_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index e330ec4..d6c3275 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -81,7 +81,7 @@ EXPORT_SYMBOL(rpmsg_create_ept); */ void rpmsg_destroy_ept(struct rpmsg_endpoint *ept) { - if (ept) + if (ept && ept->ops) ept->ops->destroy_ept(ept); } EXPORT_SYMBOL(rpmsg_destroy_ept); -- 2.7.4