浏览代码

slip: fix MTU comparation operation when reallocating buffers

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>
Matvejchikov Ilya 14 年之前
父节点
当前提交
e28634d6b2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/net/slip.c

+ 1 - 1
drivers/net/slip.c

@@ -247,7 +247,7 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
 #else
 #else
 	if (xbuff == NULL || rbuff == NULL)  {
 	if (xbuff == NULL || rbuff == NULL)  {
 #endif
 #endif
-		if (mtu >= sl->mtu) {
+		if (mtu > sl->mtu) {
 			printk(KERN_WARNING "%s: unable to grow slip buffers, MTU change cancelled.\n",
 			printk(KERN_WARNING "%s: unable to grow slip buffers, MTU change cancelled.\n",
 			       dev->name);
 			       dev->name);
 			err = -ENOBUFS;
 			err = -ENOBUFS;