stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "serdev: fix receive_buf return value when no callback" has been added to the 4.14-stable tree
@ 2018-02-23 11:11 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2018-02-23 11:11 UTC (permalink / raw)
  To: johan, alexander.levin, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    serdev: fix receive_buf return value when no callback

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     serdev-fix-receive_buf-return-value-when-no-callback.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From foo@baz Fri Feb 23 11:45:09 CET 2018
From: Johan Hovold <johan@kernel.org>
Date: Fri, 3 Nov 2017 15:30:53 +0100
Subject: serdev: fix receive_buf return value when no callback

From: Johan Hovold <johan@kernel.org>


[ Upstream commit fd00cf81a9a84776ba58e56bd042c726dcf75cf3 ]

The receive_buf callback is supposed to return the number of bytes
processed and should specifically not return a negative errno.

Due to missing sanity checks in the serdev tty-port controller, a driver
not providing a receive_buf callback could cause the flush_to_ldisc()
worker to spin in a tight loop when the tty buffer pointers are
incremented with -EINVAL (-22).

The missing sanity checks have now been added to the tty-port
controller, but let's fix up the serdev-controller helper as well.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 include/linux/serdev.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -184,7 +184,7 @@ static inline int serdev_controller_rece
 	struct serdev_device *serdev = ctrl->serdev;
 
 	if (!serdev || !serdev->ops->receive_buf)
-		return -EINVAL;
+		return 0;
 
 	return serdev->ops->receive_buf(serdev, data, count);
 }


Patches currently in stable-queue which might be from johan@kernel.org are

queue-4.14/serdev-fix-receive_buf-return-value-when-no-callback.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-23 11:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-23 11:11 Patch "serdev: fix receive_buf return value when no callback" has been added to the 4.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).