Bug 46891 - [CHECK]scsi/bnx2fc/bnx2fc_io.c:1810: bad call to memset
Summary: [CHECK]scsi/bnx2fc/bnx2fc_io.c:1810: bad call to memset
Status: CLOSED CODE_FIX
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: scsi_drivers-other
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-02 14:55 UTC by David Binderman
Modified: 2013-11-20 13:33 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.6-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description David Binderman 2012-09-02 14:55:41 UTC
I just tried to compile linux-3.6-rc4 with a recent snapshot
of the gcc compiler. It said

drivers/scsi/bnx2fc/bnx2fc_io.c:1810:41: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]

The source code is

        memset(sc_cmd->sense_buffer, 0, sizeof(sc_cmd->sense_buffer));

maybe 

        memset(sc_cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);

might be better.
Comment 1 Alan 2012-09-03 15:36:01 UTC
Yes this does appear to be the case - the warning is confusing though.
Comment 2 Bhanu Prakash Gollapudi 2012-09-03 15:53:51 UTC
Agree. I'll fix this soon.

Note You need to log in before you can comment on or make changes to this bug.