]> git.baikalelectronics.ru Git - kernel.git/commit
net: caif: fix memory leak in cfusbl_device_notify
authorPavel Skripkin <paskripkin@gmail.com>
Thu, 3 Jun 2021 16:39:35 +0000 (19:39 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 3 Jun 2021 22:05:07 +0000 (15:05 -0700)
commit7f5d86669fa4d485523ddb1d212e0a2d90bd62bb
treee555a90f8de170ffbb714f99537d929e4d6d2214
parentb53558a950a89824938e9811eddfc8efcd94e1bb
net: caif: fix memory leak in cfusbl_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: 7ad65bf68d70 ("caif: Add support for CAIF over CDC NCM USB interface")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/caif/caif_usb.c