net: caif: fix memory leak in caif_device_notify
stable inclusion from stable-v4.19.194 commit 3be863c11cab725add9fef4237ed4e232c3fc3bb category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I990A7 CVE: CVE-2021-47122 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3be863c11cab725add9fef4237ed4e232c3fc3bb --------------------------- commit b53558a9 upstream. In case of caif_enroll_dev() fail, allocated link_support won't be assigned to the corresponding structure. So simply free allocated pointer in case of error Fixes: 7c18d220 ("caif: Restructure how link caif link layer enroll") Cc: stable@vger.kernel.org Reported-and-tested-by:<syzbot+7ec324747ce876a29db6@syzkaller.appspotmail.com> Signed-off-by:
Pavel Skripkin <paskripkin@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Liu Jian <liujian56@huawei.com>
Loading
Please sign in to comment