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)
commit1c40cde6b5171d9c8dfc69be00464fd1c75e210b
treeda6ef93a602b57e13a5aed53f663812a765fac24
parent178a4ff11903cf19f35d82f3462958ab7f7c76ef
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: 15b99ac17295 ("[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