Skip to content

Commit

Permalink
slip: fix MTU comparation operation when reallocating buffers
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Matvejchikov Ilya authored and David S. Miller committed Jul 13, 2011
1 parent 30c5f8e commit e28634d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e28634d

Please sign in to comment.