]> git.hungrycats.org Git - linux/commit
NFC: st-nci: fix use of uninitialized variables in error path
authorChristophe Ricard <christophe.ricard@gmail.com>
Fri, 14 Aug 2015 20:33:34 +0000 (22:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:33:14 +0000 (19:33 +0200)
commitf7836c1c3ce1b777fa1fb8c0b6fa759d1196aee2
treefe4ab5bf8b6c71e42b74bb32a917ffa9064a0091
parent7ec2639ededfe779a05ee411374fdeedcf64de09
NFC: st-nci: fix use of uninitialized variables in error path

commit daaf1e1f1640eb11259954d1d847d8a72ab5b938 upstream.

st_nci_hci_load_session() calls kfree_skb() on unitialized
variables skb_pipe_info and skb_pipe_list if the call to
nci_hci_connect_gate() failed. Reword the error path to not use
these variables when they are not initialized. While at it, there
seemed to be a memory leak because skb_pipe_info was only freed
once, after the for-loop, even though several ones were created
by nci_hci_send_cmd.

Acked-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nfc/st-nci/st-nci_se.c