All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] target/cxgbit: Fix endianness annotations
@ 2019-10-14 11:50 Dan Carpenter
  2019-10-23  2:05 ` Martin K. Petersen
  2019-10-23  2:30 ` Bart Van Assche
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-10-14 11:50 UTC (permalink / raw)
  To: target-devel

Hello Bart Van Assche,

This is a semi-automatic email about new static checker warnings.

The patch 5cadafb236df: "target/cxgbit: Fix endianness annotations"
from Jan 13, 2017, leads to the following Smatch complaint:

    drivers/target/iscsi/cxgbit/cxgbit_cm.c:1836 cxgbit_fw4_ack()
    warn: variable dereferenced before check 'p' (see line 1834)

drivers/target/iscsi/cxgbit/cxgbit_cm.c
  1833			struct sk_buff *p = cxgbit_sock_peek_wr(csk);
  1834			const u32 csum = (__force u32)p->csum;
                                                      ^^^^^^^
We moved this dereference earlier

  1835	
  1836			if (unlikely(!p)) {
                                      ^
so now it's before the NULL check

  1837				pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n",
  1838				       csk, csk->tid, credits,

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] target/cxgbit: Fix endianness annotations
  2019-10-14 11:50 [bug report] target/cxgbit: Fix endianness annotations Dan Carpenter
@ 2019-10-23  2:05 ` Martin K. Petersen
  2019-10-23  2:30 ` Bart Van Assche
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2019-10-23  2:05 UTC (permalink / raw)
  To: target-devel


Bart?

> This is a semi-automatic email about new static checker warnings.
>
> The patch 5cadafb236df: "target/cxgbit: Fix endianness annotations"
> from Jan 13, 2017, leads to the following Smatch complaint:
>
>     drivers/target/iscsi/cxgbit/cxgbit_cm.c:1836 cxgbit_fw4_ack()
>     warn: variable dereferenced before check 'p' (see line 1834)
>
> drivers/target/iscsi/cxgbit/cxgbit_cm.c
>   1833			struct sk_buff *p = cxgbit_sock_peek_wr(csk);
>   1834			const u32 csum = (__force u32)p->csum;
>                                                       ^^^^^^^
> We moved this dereference earlier
>
>   1835	
>   1836			if (unlikely(!p)) {
>                                       ^
> so now it's before the NULL check
>
>   1837				pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n",
>   1838				       csk, csk->tid, credits,
>

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] target/cxgbit: Fix endianness annotations
  2019-10-14 11:50 [bug report] target/cxgbit: Fix endianness annotations Dan Carpenter
  2019-10-23  2:05 ` Martin K. Petersen
@ 2019-10-23  2:30 ` Bart Van Assche
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2019-10-23  2:30 UTC (permalink / raw)
  To: target-devel

On 2019-10-22 19:05, Martin K. Petersen wrote:
> 
> Bart?
> 
>> This is a semi-automatic email about new static checker warnings.
>>
>> The patch 5cadafb236df: "target/cxgbit: Fix endianness annotations"
>> from Jan 13, 2017, leads to the following Smatch complaint:
>>
>>     drivers/target/iscsi/cxgbit/cxgbit_cm.c:1836 cxgbit_fw4_ack()
>>     warn: variable dereferenced before check 'p' (see line 1834)
>>

Hi Martin,

Thanks for the reminder - Dan's email had escaped from my attention. I
will submit a patch.

Bart.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-23  2:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-14 11:50 [bug report] target/cxgbit: Fix endianness annotations Dan Carpenter
2019-10-23  2:05 ` Martin K. Petersen
2019-10-23  2:30 ` Bart Van Assche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.