1. 02 Jul, 2018 2 commits
    • Dan Carpenter's avatar
      scsi: qedi: tidy up a size calculation · 915d9b71
      Dan Carpenter authored
      The id_tbl->table pointer points to unsigned long so static checkers
      complain that instead of 4 we should be allocating sizeof(long) bytes.
      
      We're trying to allocate enough bits for the bitmap.  The size variable is
      always 1024.  (1024 / 32 * 4) is the same as (1024 / 64 * 8) so this
      doesn't change runtime, but this is the more idiomatic way to do it and
      makes the static checker happy.
      
      [mkp: typo]
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarManish Rangankar <Manish.Rangankar@cavium.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      915d9b71
    • Breno Leitao's avatar
      scsi: ibmvscsi: Improve strings handling · 1262dc09
      Breno Leitao authored
      Currently an open firmware property is copied into partition_name variable
      without keeping a room for \0.
      
      Later one, this variable (partition_name), which is 97 bytes long, is
      strncpyed into ibmvcsci_host_data->madapter_info->partition_name, which is
      96 bytes long, possibly truncating it 'again' and removing the \0.
      
      This patch simply decreases the partition name to 96 and just copy using
      strlcpy() which guarantees that the string is \0 terminated. I think there
      is no issue if this there is a truncation in this very first copy, i.e,
      when the open firmware property is read and copied into the driver for the
      very first time;
      
      This issue also causes the following warning on GCC 8:
      
      	drivers/scsi/ibmvscsi/ibmvscsi.c:281:2: warning:  strncpy  output may be truncated copying 96 bytes from a string of length 96 [-Wstringop-truncation]
      	...
      	inlined from  ibmvscsi_probe  at drivers/scsi/ibmvscsi/ibmvscsi.c:2221:7:
      	drivers/scsi/ibmvscsi/ibmvscsi.c:265:3: warning:  strncpy  specified bound 97 equals destination size [-Wstringop-truncation]
      
      CC: Bart Van Assche <bart.vanassche@wdc.com>
      CC: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Signed-off-by: default avatarBreno Leitao <leitao@debian.org>
      Acked-by: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      1262dc09
  2. 26 Jun, 2018 23 commits
  3. 22 Jun, 2018 1 commit
  4. 20 Jun, 2018 14 commits