Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp735713imm; Fri, 27 Jul 2018 05:20:09 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeuMOzQ6M1Ay9Ob58JIMWwZPrmEA12UuzNwUZBgZ4taVm/6hMsKsQs6xHm6IvtQvASZTXKn X-Received: by 2002:a62:4ece:: with SMTP id c197-v6mr6537818pfb.240.1532694009358; Fri, 27 Jul 2018 05:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532694009; cv=none; d=google.com; s=arc-20160816; b=hPViY4uJW0ZrYAMW6wbgoc31w87rS3liY5rU55ibETh6z2W4qgR08lK3N9fXnoHnmK oICFvh7Sq4zLGC5DK5BJ/HmdM5NoZeak7sMH/tkwnMHWxw1l7klmXh1uBiEWDaM5/2BO Ard8VYhMtbuKolz+vUZM7DkayoEX7pHOYnexTHsvM+WUipqP7nRKoURrGRet6Ssiysby 4mEX7dhKKjcz1UtZHlVq86vsr6R3IUtSeoDpnpEg4iU953LUTQyHX08KYYa/W2DIqgmS mRsHKLnQ1JOAO2R29RyJ1uqQJ8EDFeCgptN3jQ4I2hJrvUgbLjPWE+GvaMpDRnxhSwMk of+g== 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:dkim-signature :arc-authentication-results; bh=RQq5EbSiowUY4tIz709Eq6W4qhCeJcmdtqcbJKLBXtg=; b=wCXY5cfja8qOs5C+ItUr/4UvIBB+dwk9GckrhvmHi2k40p9VFZvVl/gQE6kdwi78Wx rXIvOjuNoBx5R7V5cvFc0D1/xgEOl9s1lU8UDlxSwhyUzbtFezHZM2DwJtPFet5UTizE yNqFfbRhpg40Lzsd+hUAkwM4cxzYBW2qpVki6fkPo17wNdJnz9SL8GhTnbz86pZvH4I1 6PffYtScys+EAbD7VVGlXUJoLgbqgfTkYLx0+RsxRpYOaHAhrI/f9M7piLLOi7vGSUfY bex5oSOAFLIrd3TnscS/G3IY37/KRkwqyqeyMVhqzV+uBkV7YG6JUnqpPe9cIXj0atEA lXtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=P6vtYGRN; dkim=pass header.i=@codeaurora.org header.s=default header.b=P6vtYGRN; 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 m30-v6si3692340pgc.361.2018.07.27.05.19.54; Fri, 27 Jul 2018 05:20:09 -0700 (PDT) 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=P6vtYGRN; dkim=pass header.i=@codeaurora.org header.s=default header.b=P6vtYGRN; 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 S2388622AbeG0NkT (ORCPT + 99 others); Fri, 27 Jul 2018 09:40:19 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46054 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730488AbeG0NkS (ORCPT ); Fri, 27 Jul 2018 09:40:18 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3FB7560B7E; Fri, 27 Jul 2018 12:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693918; bh=BY/aSkH9MI7NgUAIsPWv/6I20fPzcHPW17eOSShBZ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6vtYGRNCpTxUXnBCKfghNj3aRSk59pRSezjkdKJRq3lmb+VW1Zv4FCIy4yC3veh5 38qwcVc9dx8KVC4K11wrzmCGURfGPLnUNvRUkGPcTMvj8uRzTAj2s7SIDea99nvja9 Pukctgh5vwVZPRKqSK4biSupc6QK9QASu3bqq49Y= 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.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no 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@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 0650360B7B; Fri, 27 Jul 2018 12:18:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532693918; bh=BY/aSkH9MI7NgUAIsPWv/6I20fPzcHPW17eOSShBZ8Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6vtYGRNCpTxUXnBCKfghNj3aRSk59pRSezjkdKJRq3lmb+VW1Zv4FCIy4yC3veh5 38qwcVc9dx8KVC4K11wrzmCGURfGPLnUNvRUkGPcTMvj8uRzTAj2s7SIDea99nvja9 Pukctgh5vwVZPRKqSK4biSupc6QK9QASu3bqq49Y= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0650360B7B 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=aneela@codeaurora.org From: Arun Kumar Neelakantam To: ohad@wizery.com, bjorn.andersson@linaro.org, clew@codeaurora.org, robh+dt@kernel.org, arnaud.pouliquen@st.com, andy.gross@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Arun Kumar Neelakantam Subject: [PATCH V4 4/9] rpmsg: Guard against null endpoint ops in destroy Date: Fri, 27 Jul 2018 17:47:24 +0530 Message-Id: <1532693849-7037-5-git-send-email-aneela@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532693849-7037-1-git-send-email-aneela@codeaurora.org> References: <1532693849-7037-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 b714a54..0860328 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -80,7 +80,7 @@ struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev, */ void rpmsg_destroy_ept(struct rpmsg_endpoint *ept) { - if (ept) + if (ept && ept->ops) ept->ops->destroy_ept(ept); } EXPORT_SYMBOL(rpmsg_destroy_ept); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project