提交 e28634d6 编写于 作者: M Matvejchikov Ilya 提交者: David S. Miller

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: NMatvejchikov Ilya <matvejchikov@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 30c5f8ec
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册