linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] netiucv: silence an underflow warning
@ 2016-07-14 11:30 Dan Carpenter
  2016-07-15  7:11 ` Ursula Braun
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-07-14 11:30 UTC (permalink / raw)
  To: Ursula Braun
  Cc: Martin Schwidefsky, Heiko Carstens, linux-s390, linux-kernel,
	kernel-janitors

I haven't looked at the implications but we accidentally allow bs1 to
be negative.  It makes my static checker complain.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index b0e8ffd..85a5744 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1578,7 +1578,7 @@ static ssize_t buffer_write (struct device *dev, struct device_attribute *attr,
 			*e);
 		return -EINVAL;
 	}
-	if (bs1 > NETIUCV_BUFSIZE_MAX) {
+	if (bs1 < 0 || bs1 > NETIUCV_BUFSIZE_MAX) {
 		IUCV_DBF_TEXT_(setup, 2,
 			"buffer_write: buffer size %d too large\n",
 			bs1);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-15  8:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-14 11:30 [patch] netiucv: silence an underflow warning Dan Carpenter
2016-07-15  7:11 ` Ursula Braun
2016-07-15  8:33   ` Dan Carpenter

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).