staging: rtl8712: fix potential leaks in r8712_set_key()
authorChristian Engelmayer <cengelma@gmx.at>
Wed, 7 May 2014 19:40:41 +0000 (21:40 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 May 2014 16:57:14 +0000 (01:57 +0900)
commit2af9e74ae6b013a6e30d631246db7825185abac0
tree5f8f64c951bdcd2691a3b2ece405064f4baace79
parent55d4f6cc4c922123cf8eb7b428191a0c33f08704
staging: rtl8712: fix potential leaks in r8712_set_key()

Fix potential leaks in the error paths of r8712_set_key(). In case the
algorithm specific checks fail, the function returns without enqueuing
or freeing the already allocated command and parameter structs. Use a
centralized exit path and make sure that all memory is freed correctly.
Detected by Coverity - CID 144370, 144371.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl871x_mlme.c