RE: [patch 2/2] megaraid_sas: missing curly braces in megasas_detach_one()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
> Sent: Saturday, November 07, 2015 9:47 PM
> To: Kashyap Desai; Sumit Saxena
> Cc: Uday Lingala; James E.J. Bottomley; megaraidlinux.pdl@xxxxxxxxxxxxx;
> linux-scsi@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [patch 2/2] megaraid_sas: missing curly braces in
> megasas_detach_one()
>
> The indenting indicates that there are supposed to be some curly braces
> here.  Presumably it means we free something unintentionally leading to
a
> use after free.

NACK. Indentation is wrong. We don't need to add braces. We will fix
indentation and resend patch. Since this is not critical, let's ignore for
now.
>
> Fixes: 3761cb4cf65e ('megaraid_sas: JBOD sequence number support')
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> ---
> Not tested.
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 829e9e9..91e200d 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -5932,7 +5932,7 @@ static void megasas_detach_one(struct pci_dev
> *pdev)
>  						  fusion->max_map_sz,
>  						  fusion->ld_map[i],
>  						  fusion->ld_map_phys[i]);
> -			if (fusion->ld_drv_map[i])
> +			if (fusion->ld_drv_map[i]) {
>  				free_pages((ulong)fusion->ld_drv_map[i],
>  					fusion->drv_map_pages);
>  				if (fusion->pd_seq_sync)
> @@ -5940,6 +5940,7 @@ static void megasas_detach_one(struct pci_dev
> *pdev)
>  						pd_seq_map_sz,
>  						fusion->pd_seq_sync[i],
>  						fusion->pd_seq_phys[i]);
> +			}
>  		}
>  		free_pages((ulong)instance->ctrl_context,
>  			instance->ctrl_context_pages);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux