netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/4] slip: fix MTU comparation operation when reallocating buffers
@ 2011-07-13  7:46 Matvejchikov Ilya
  2011-07-13  9:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Matvejchikov Ilya @ 2011-07-13  7:46 UTC (permalink / raw)
  To: netdev; +Cc: matvejchikov

In sl_realloc_bufs() there is no reason to check if the requested MTU greater
than or equal to the current MTU value as this function called only
when requested
MTU not equals to the current value. So, the ">=" operation can be
safely replaced
with the ">".

Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
---
 drivers/net/slip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/slip.c b/drivers/net/slip.c
index e8c4582..d724d47 100644
--- a/drivers/net/slip.c
+++ b/drivers/net/slip.c
@@ -247,7 +247,7 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
 #else
 	if (xbuff == NULL || rbuff == NULL)  {
 #endif
-		if (mtu >= sl->mtu) {
+		if (mtu > sl->mtu) {
 			printk(KERN_WARNING "%s: unable to grow slip buffers, MTU change
cancelled.\n",
 			       dev->name);
 			err = -ENOBUFS;
-- 
1.7.6

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

* Re: [PATCH 2/4] slip: fix MTU comparation operation when reallocating buffers
  2011-07-13  7:46 [PATCH 2/4] slip: fix MTU comparation operation when reallocating buffers Matvejchikov Ilya
@ 2011-07-13  9:32 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-07-13  9:32 UTC (permalink / raw)
  To: matvejchikov; +Cc: netdev

From: Matvejchikov Ilya <matvejchikov@gmail.com>
Date: Wed, 13 Jul 2011 11:46:17 +0400

> In sl_realloc_bufs() there is no reason to check if the requested MTU greater
> than or equal to the current MTU value as this function called only
> when requested
> MTU not equals to the current value. So, the ">=" operation can be
> safely replaced
> with the ">".
> 
> Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>

Patch corrupted by email client:

>  			printk(KERN_WARNING "%s: unable to grow slip buffers, MTU change
> cancelled.\n",

That should be one line.

I applied this by hand.

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

end of thread, other threads:[~2011-07-13  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-13  7:46 [PATCH 2/4] slip: fix MTU comparation operation when reallocating buffers Matvejchikov Ilya
2011-07-13  9:32 ` David Miller

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