]> git.baikalelectronics.ru Git - kernel.git/commit
net: caif: fix memory leak in caif_device_notify
authorPavel Skripkin <paskripkin@gmail.com>
Thu, 3 Jun 2021 16:39:11 +0000 (19:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jun 2021 22:05:07 +0000 (15:05 -0700)
commitb53558a950a89824938e9811eddfc8efcd94e1bb
treecffe51ae8ead138fa2648c1eef0166674d38f7fb
parenta2805dca5107d5603f4bbc027e81e20d93476e96
net: caif: fix memory leak in caif_device_notify

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: 7c18d2205ea7 ("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>
net/caif/caif_dev.c