diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-03-30 14:55:08 +0200 |
---|---|---|
committer | Thomas Huth <thuth@linux.vnet.ibm.com> | 2011-06-06 15:30:22 +0200 |
commit | 5a9155e834dd21a7e3acb2cb2f6c6274253373fc (patch) | |
tree | 7da5561b7c314cbda0ff46241b8a03c6bcb585fc | |
parent | d1d6b53b713a2b7c2c25685268fa932d28a4b4c0 (diff) | |
download | SLOF-5a9155e834dd21a7e3acb2cb2f6c6274253373fc.zip SLOF-5a9155e834dd21a7e3acb2cb2f6c6274253373fc.tar.gz SLOF-5a9155e834dd21a7e3acb2cb2f6c6274253373fc.tar.bz2 |
Fixed problem with potentially unitialized variable.
GCC complained about an uninitialized variable in the veth_receive() receive
function. And indeed, the buf variable might have been used uninitialized here
when the packet could not be handled and the code jumped to the recycle part
immediately.
Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r-- | board-qemu/veth/veth.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/board-qemu/veth/veth.c b/board-qemu/veth/veth.c index 0bbaebe..dbfcad5 100644 --- a/board-qemu/veth/veth.c +++ b/board-qemu/veth/veth.c @@ -204,6 +204,8 @@ static int veth_receive(char *f_buffer_pc, int f_len_i) union ibmveth_buf_desc bdesc; void *buf; + buf = (void *)desc->correlator; + if ((desc->flags_off & IBMVETH_RXQ_TOGGLE) != cur_rx_toggle) break; @@ -215,7 +217,6 @@ static int veth_receive(char *f_buffer_pc, int f_len_i) goto recycle; } - buf = (void *)desc->correlator; packet = desc->length; memcpy(f_buffer_pc, buf + (desc->flags_off & IBMVETH_RXQ_OFF_MASK), packet); |