summaryrefslogtreecommitdiffstats
path: root/include/net/caif/caif_dev.h
diff options
context:
space:
mode:
authorPavel Skripkin <paskripkin@gmail.com>2021-06-03 18:38:51 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-04 00:05:06 +0200
commita2805dca5107d5603f4bbc027e81e20d93476e96 (patch)
tree922655a2a8a02688d837e864ccef6506a2b24342 /include/net/caif/caif_dev.h
parentnet: caif: added cfserl_release function (diff)
downloadlinux-a2805dca5107d5603f4bbc027e81e20d93476e96.tar.xz
linux-a2805dca5107d5603f4bbc027e81e20d93476e96.zip
net: caif: add proper error handling
caif_enroll_dev() can fail in some cases. Ingnoring these cases can lead to memory leak due to not assigning link_support pointer to anywhere. Fixes: 7c18d2205ea7 ("caif: Restructure how link caif link layer enroll") Cc: stable@vger.kernel.org Signed-off-by: Pavel Skripkin <paskripkin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/caif/caif_dev.h')
-rw-r--r--include/net/caif/caif_dev.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h
index 48ecca8530ff..b655d8666f55 100644
--- a/include/net/caif/caif_dev.h
+++ b/include/net/caif/caif_dev.h
@@ -119,7 +119,7 @@ void caif_free_client(struct cflayer *adap_layer);
* The link_support layer is used to add any Link Layer specific
* framing.
*/
-void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
+int caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev,
struct cflayer *link_support, int head_room,
struct cflayer **layer, int (**rcv_func)(
struct sk_buff *, struct net_device *,