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>
Fri, 13 Dec 2019 07:52:59 +0000 (08:52 +0100)
commit0977763a13fd87a7aebe376dc96385758de3aa9e
tree10c0fdd7567fdf4ab5ea8a047a2a59d10e911d9e
parent754e3c0c31c96cf3a4a54ed2a8c63cca28109136
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>
Cc: 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