]> git.baikalelectronics.ru Git - kernel.git/commit
arcnet: fix potential memory leak in com20020_probe()
authorWang Hai <wanghai38@huawei.com>
Sun, 20 Nov 2022 06:24:38 +0000 (14:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Nov 2022 12:41:54 +0000 (12:41 +0000)
commit8a6c4b38ed804563a8050274eeaeb247b01a523f
treeda6ef93a602b57e13a5aed53f663812a765fac24
parent341cdb8fcb581ecfb82a14e55cf097960346ac26
arcnet: fix potential memory leak in com20020_probe()

In com20020_probe(), if com20020_config() fails, dev and info
will not be freed, which will lead to a memory leak.

This patch adds freeing dev and info after com20020_config()
fails to fix this bug.

Compile tested only.

Fixes: 16cd360085fe ("[PATCH] pcmcia: add return value to _config() functions")
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/arcnet/com20020_cs.c