]> git.baikalelectronics.ru Git - kernel.git/commit
wlcore: fix usage of platform_device_add_data()
authorChristian Engelmayer <cengelma@gmx.at>
Thu, 24 Apr 2014 20:35:56 +0000 (22:35 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 30 Apr 2014 16:08:17 +0000 (12:08 -0400)
commit46008274df390908a2cfba0d5668cce1638e6439
treec88ff4f45b1b32e0b84c148602719d001c5c0c53
parent5098866b900f8d0b749b5bd883cfa08c413fbc2d
wlcore: fix usage of platform_device_add_data()

Coverity CID 986698 reports leakage of struct wlcore_platdev_data in the
probe functions of both the SPI/SDIO interfaces. The structure passed to
platform_device_add_data() is dynamically allocated and only freed in the
error paths, however, platform_device_add_data() adds a copy of the platform
specific data to the device. Move the temporary struct that is kmemdup'ed
to the stack. This issue exists since 818a8a04 (wlcore: remove if_ops from
platform_data).

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ti/wlcore/sdio.c
drivers/net/wireless/ti/wlcore/spi.c