]> 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)
commitf6ba32a778501afbfd3c4b80adb2a7df2485643c
treeda6ef93a602b57e13a5aed53f663812a765fac24
parent7c58ed08ebf5a36559f0c31850ba67b5ee690667
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