appletalk: Fix potential NULL pointer dereference in unregister_snap_client
authorYueHaibing <yuehaibing@huawei.com>
Thu, 14 Mar 2019 05:47:59 +0000 (13:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Dec 2019 09:41:44 +0000 (10:41 +0100)
commit540b341012ba9b8e2963be3241cea229d4e4804d
tree11ae0126afec20a6a4e6890148e09eb0007c2b2c
parent8b587e3f1424fae01f9c7e78d8d294bcb71f6f41
appletalk: Fix potential NULL pointer dereference in unregister_snap_client

commit 9804501fa1228048857910a6bf23e085aade37cc upstream.

register_snap_client may return NULL, all the callers
check it, but only print a warning. This will result in
NULL pointer dereference in unregister_snap_client and other
places.

It has always been used like this since v2.6

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[bwh: Backported to <4.15: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/atalk.h
net/appletalk/aarp.c
net/appletalk/ddp.c