]> git.baikalelectronics.ru Git - kernel.git/commit
slip: make slhc_free() silently accept an error pointer
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Apr 2019 23:13:58 +0000 (16:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 27 Apr 2019 01:19:09 +0000 (18:19 -0700)
commit97fd98a463984cadd9db07551c0a9799f70c100f
tree39120990be591697b26a244388918c03675823af
parent71a0338130bbcb4b70989ea3a55e7b0123c737a5
slip: make slhc_free() silently accept an error pointer

This way, slhc_free() accepts what slhc_init() returns, whether that is
an error or not.

In particular, the pattern in sl_alloc_bufs() is

        slcomp = slhc_init(16, 16);
        ...
        slhc_free(slcomp);

for the error handling path, and rather than complicate that code, just
make it ok to always free what was returned by the init function.

That's what the code used to do before commit 234dd358be96 ("ppp, slip:
Validate VJ compression slot parameters completely") when slhc_init()
just returned NULL for the error case, with no actual indication of the
details of the error.

Reported-by: syzbot+45474c076a4927533d2e@syzkaller.appspotmail.com
Fixes: 234dd358be96 ("ppp, slip: Validate VJ compression slot parameters completely")
Acked-by: Ben Hutchings <ben@decadent.org.uk>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/net/slip/slhc.c