mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Initialize off value in asd_process_ctrl_a_user()
@ 2014-12-02 16:34 Eric B Munson
  2014-12-28 15:12 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Eric B Munson @ 2014-12-02 16:34 UTC (permalink / raw)
  To: JBottomley; +Cc: linux-scsi, linux-kernel, Eric B Munson, stable

If the asd_find_flash_de() function returns ENOENT the off value will
be used uninitialized in the call to asd_read_flash_seg().

Signed-off-by: Eric B Munson <emunson@akamai.com>
Cc: stable@vger.kernel.org
---
 drivers/scsi/aic94xx/aic94xx_sds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c
index edb43fd..6f6a5b8 100644
--- a/drivers/scsi/aic94xx/aic94xx_sds.c
+++ b/drivers/scsi/aic94xx/aic94xx_sds.c
@@ -982,7 +982,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha,
 				   struct asd_flash_dir *flash_dir)
 {
 	int err, i;
-	u32 offs, size;
+	u32 offs = 0, size;
 	struct asd_ll_el *el;
 	struct asd_ctrla_phy_settings *ps;
 	struct asd_ctrla_phy_settings dflt_ps;
-- 
1.9.1


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

* Re: [PATCH] Initialize off value in asd_process_ctrl_a_user()
  2014-12-02 16:34 [PATCH] Initialize off value in asd_process_ctrl_a_user() Eric B Munson
@ 2014-12-28 15:12 ` Ben Hutchings
  2014-12-30 12:04   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2014-12-28 15:12 UTC (permalink / raw)
  To: Eric B Munson; +Cc: JBottomley, linux-scsi, linux-kernel, stable

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Tue, 2014-12-02 at 11:34 -0500, Eric B Munson wrote:
> If the asd_find_flash_de() function returns ENOENT the off value will
> be used uninitialized in the call to asd_read_flash_seg().

This is just papering over the problem.  This was my attempt at a proper
fix: http://article.gmane.org/gmane.linux.scsi/91320

Ben.

> Signed-off-by: Eric B Munson <emunson@akamai.com>
> Cc: stable@vger.kernel.org
> ---
>  drivers/scsi/aic94xx/aic94xx_sds.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/aic94xx/aic94xx_sds.c b/drivers/scsi/aic94xx/aic94xx_sds.c
> index edb43fd..6f6a5b8 100644
> --- a/drivers/scsi/aic94xx/aic94xx_sds.c
> +++ b/drivers/scsi/aic94xx/aic94xx_sds.c
> @@ -982,7 +982,7 @@ static int asd_process_ctrl_a_user(struct asd_ha_struct *asd_ha,
>  				   struct asd_flash_dir *flash_dir)
>  {
>  	int err, i;
> -	u32 offs, size;
> +	u32 offs = 0, size;
>  	struct asd_ll_el *el;
>  	struct asd_ctrla_phy_settings *ps;
>  	struct asd_ctrla_phy_settings dflt_ps;

-- 
Ben Hutchings
Life would be so much easier if we could look at the source code.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH] Initialize off value in asd_process_ctrl_a_user()
  2014-12-28 15:12 ` Ben Hutchings
@ 2014-12-30 12:04   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-12-30 12:04 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Eric B Munson, JBottomley, linux-scsi, linux-kernel, stable

On Sun, Dec 28, 2014 at 04:12:16PM +0100, Ben Hutchings wrote:
> On Tue, 2014-12-02 at 11:34 -0500, Eric B Munson wrote:
> > If the asd_find_flash_de() function returns ENOENT the off value will
> > be used uninitialized in the call to asd_read_flash_seg().
> 
> This is just papering over the problem.  This was my attempt at a proper
> fix: http://article.gmane.org/gmane.linux.scsi/91320


That one looks much more useful to me.  Can someone give it a second
review?

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

end of thread, other threads:[~2014-12-30 12:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-02 16:34 [PATCH] Initialize off value in asd_process_ctrl_a_user() Eric B Munson
2014-12-28 15:12 ` Ben Hutchings
2014-12-30 12:04   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®