Re: ultrastor.c is a bit-rot

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

 



On Mon, 2008-03-17 at 19:01 +0200, Boaz Harrosh wrote:
> In Hebrew we say: "You make me drink Kerosene". 

Slàinte mhath as we say in English.

> An "obvious enough to apply the best straight line fix" submitted below:
> 
> I say dump it, it's unused.
> 
> Boaz
> ---
> From: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
> Date: Mon, 17 Mar 2008 18:40:03 +0200
> Subject: [PATCH] ultrastor: Fix for ISA DMA allocation
> 
> "obvious enough to apply the best straight line fix" submitted
> below.
> 
> Signed-off-by: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
> CC: Andi Kleen <ak@xxxxxxx>
> ---
>  drivers/scsi/ultrastor.c |   24 +++++++++++++++++++++---
>  1 files changed, 21 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
> index f385dce..04441eb 100644
> --- a/drivers/scsi/ultrastor.c
> +++ b/drivers/scsi/ultrastor.c
> @@ -255,8 +255,9 @@ static struct ultrastor_config
>    unsigned long mscp_free;
>  #endif
>    volatile unsigned char aborted[ULTRASTOR_MAX_CMDS];
> -  struct mscp mscp[ULTRASTOR_MAX_CMDS];
> -} config = {0};
> +  struct mscp *mscp;
> +  dma_addr_t dma;
> +} config;
>  
>  /* Set this to 1 to reset the SCSI bus on error.  */
>  static int ultrastor_bus_reset;
> @@ -646,12 +647,29 @@ static int ultrastor_24f_detect(struct scsi_host_template * tpnt)
>  
>  static int ultrastor_detect(struct scsi_host_template * tpnt)
>  {
> +	int ret;
> +
>  	tpnt->proc_name = "ultrastor";
> -	return ultrastor_14f_detect(tpnt) || ultrastor_24f_detect(tpnt);
> +
> +	if (!config.mscp)
> +		config.mscp = dma_alloc_coherent(NULL,
> +			sizeof(*config.mscp) * ULTRASTOR_MAX_CMDS,
> +			&config.dma, GFP_KERNEL);

Error handling here, I'm afraid; dma_alloc_coherent can return NULL.

Other than that, looks great.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux