diff mbox series

[V7,2/4] rpmsg: Guard against null endpoint ops in destroy

Message ID 1593017121-7953-3-git-send-email-deesin@codeaurora.org (mailing list archive)
State Accepted
Commit d5158cda9e7b66fd412815df32e58943b7383f0c
Headers show
Series [V7,1/4] rpmsg: glink: Use complete_all for open states | expand

Commit Message

Deepak Kumar Singh June 24, 2020, 4:45 p.m. UTC
From: Chris Lew <clew@codeaurora.org>

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 <clew@codeaurora.org>
Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
---
 drivers/rpmsg/rpmsg_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg Kroah-Hartman Aug. 7, 2020, 7:59 a.m. UTC | #1
On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
> From: Chris Lew <clew@codeaurora.org>
> 
> 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 <clew@codeaurora.org>
> Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
> Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>

Should this be marked for stable kernels?

And if so, what commit does this fix?  Any reason the Fixes: tag was not
used here?

And what happened to this series?  I don't see it in linux-next, did the
maintainer ignore it?

thanks,

greg k-h
Chris Lew Aug. 8, 2020, 12:33 a.m. UTC | #2
Hi Greg,

On 8/7/2020 12:59 AM, Greg KH wrote:
> On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
>> From: Chris Lew <clew@codeaurora.org>
>>
>> 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 <clew@codeaurora.org>
>> Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
>> Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
> 
> Should this be marked for stable kernels?
> 
> And if so, what commit does this fix?  Any reason the Fixes: tag was not
> used here?
> 

The crash that this fixes doesn't show up unless one of the previous 
patches in the series is applied.

[PATCH V6 3/5] rpmsg: glink: Add support for rpmsg glink chrdev

I'm not sure if the fixes tag should apply to this change or one of the 
commits to the base rpmsg code.

> And what happened to this series?  I don't see it in linux-next, did the
> maintainer ignore it?
> 

I believe most of the review feedback for the series has been addressed 
by Deepak. There is one remaining action item for me and Deepak to 
provide more concrete evidence that the first patch in the series is 
needed.

[PATCH V6 1/5] rpmsg: glink: Use complete_all for open states

> thanks,
> 
> greg k-h
> 

Thanks,
Chris
Greg Kroah-Hartman Aug. 8, 2020, 5:55 a.m. UTC | #3
On Fri, Aug 07, 2020 at 05:33:53PM -0700, Chris Lew wrote:
> Hi Greg,
> 
> On 8/7/2020 12:59 AM, Greg KH wrote:
> > On Wed, Jun 24, 2020 at 10:15:19PM +0530, Deepak Kumar Singh wrote:
> > > From: Chris Lew <clew@codeaurora.org>
> > > 
> > > 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 <clew@codeaurora.org>
> > > Signed-off-by: Deepak Kumar Singh <deesin@codeaurora.org>
> > > Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
> > 
> > Should this be marked for stable kernels?
> > 
> > And if so, what commit does this fix?  Any reason the Fixes: tag was not
> > used here?
> > 
> 
> The crash that this fixes doesn't show up unless one of the previous patches
> in the series is applied.
> 
> [PATCH V6 3/5] rpmsg: glink: Add support for rpmsg glink chrdev
> 
> I'm not sure if the fixes tag should apply to this change or one of the
> commits to the base rpmsg code.

That's a different series, why not merge this patch with that one so
there is no need for a fix if none of this has been merged yet?

> > And what happened to this series?  I don't see it in linux-next, did the
> > maintainer ignore it?
> > 
> 
> I believe most of the review feedback for the series has been addressed by
> Deepak. There is one remaining action item for me and Deepak to provide more
> concrete evidence that the first patch in the series is needed.
> 
> [PATCH V6 1/5] rpmsg: glink: Use complete_all for open states

Ok, thanks, just didn't want to see this get forgotten...

greg k-h
diff mbox series

Patch

diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index a6361ca..91de940 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);