Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1616447 > unrolled thread

Re: [PATCH] scsi: advansys: fix uninitialized data access

Started by"Martin K. Petersen" <martin.petersen@oracle.com>
First post2017-04-05 01:50 +0200
Last post2017-04-05 01:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] scsi: advansys: fix uninitialized data access "Martin K. Petersen" <martin.petersen@oracle.com> - 2017-04-05 01:50 +0200

#1616447 — Re: [PATCH] scsi: advansys: fix uninitialized data access

From"Martin K. Petersen" <martin.petersen@oracle.com>
Date2017-04-05 01:50 +0200
SubjectRe: [PATCH] scsi: advansys: fix uninitialized data access
Message-ID<tsGmZ-3eo-3@gated-at.bofh.it>
Arnd Bergmann <arnd@arndb.de> writes:

Arnd,

> drivers/scsi/advansys.c: In function 'AscMsgOutSDTR':
> drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+5)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>          ((ushort)s_buffer[i + 1] << 8) | s_buffer[i]);
>                           ^
> drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+7)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+5)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/scsi/advansys.c:3860:26: error: '*((void *)&sdtr_buf+7)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> The code has existed in this exact form at least since v2.6.12, and the
> warning seems correct. This uses named initializers to ensure we initialize
> all members of the structure.
>  					(uchar *)&sdtr_buf,

Applied to 4.12/scsi-queue, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web