rsi: Fix a potential memory leak in rsi_set_channel()
authorChristian Engelmayer <cengelma@gmx.at>
Wed, 9 Apr 2014 19:28:54 +0000 (21:28 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 14 Apr 2014 18:31:41 +0000 (14:31 -0400)
commit98ddcbe03366c19b6da9b75a00f9c8d0a7c2dc6d
tree0efecf018f2d0313d2a2adb665defdc008c2c03a
parentaf64dc7474a43fb653255ecf8ae879c8227feab2
rsi: Fix a potential memory leak in rsi_set_channel()

Fix a potential memory leak in function rsi_set_channel() that is used to
program channel changes. The channel check block for the frequency bands
directly exits the function in case of an error, thus leaving an already
allocated skb unreferenced. Move the checks above allocating the skb.
Detected by Coverity: CID 1195576.

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