Message ID | 1408001361-13580-2-git-send-email-zhang.zhanghailiang@huawei.com |
---|---|
State | New |
Headers | show |
On Thu, Aug 14, 2014 at 03:29:12PM +0800, zhanghailiang wrote: > Pointer 'ch' will be used in function 'l2cap_channel_open_req_msg' after > it was previously freed in 'l2cap_channel_open'. > Assigned it to NULL after it is freed. Reviewed-by: Michael S. Tsirkin <mst@redhat.com> > > Reviewed-by: Alex Bennée <alex.bennee@linaro.org> > Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> > --- > hw/bt/l2cap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c > index 2301d6f..591e047 100644 > --- a/hw/bt/l2cap.c > +++ b/hw/bt/l2cap.c > @@ -429,7 +429,7 @@ static struct l2cap_chan_s *l2cap_channel_open(struct l2cap_instance_s *l2cap, > status = L2CAP_CS_NO_INFO; > } else { > g_free(ch); > - > + ch = NULL; > result = L2CAP_CR_NO_MEM; > status = L2CAP_CS_NO_INFO; > } > -- > 1.7.12.4 >
Applied to -trivial, thanks! /mjt
diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index 2301d6f..591e047 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -429,7 +429,7 @@ static struct l2cap_chan_s *l2cap_channel_open(struct l2cap_instance_s *l2cap, status = L2CAP_CS_NO_INFO; } else { g_free(ch); - + ch = NULL; result = L2CAP_CR_NO_MEM; status = L2CAP_CS_NO_INFO; }