Commit ed508104 authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

soccr: don't dereference data before null check

CID 173075 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking data suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

travis-ci: success for soccr: don't dereference data before null check
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent f3e3958b
......@@ -400,15 +400,16 @@ static int set_queue_seq(struct libsoccr_sk *sk, int queue, __u32 seq)
static int libsoccr_set_sk_data_noq(struct libsoccr_sk *sk,
struct libsoccr_sk_data *data, unsigned data_size)
{
int mstate = 1 << data->state;
struct tcp_repair_opt opts[4];
int addr_size;
int addr_size, mstate;
int onr = 0;
__u32 seq;
if (!data || data_size < SOCR_DATA_MIN_SIZE)
return -1;
mstate = 1 << data->state;
if (data->state == TCP_LISTEN)
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment