[Stgt-devel] [PATCH] add stgt_device_template example

Mike Christie michaelc at cs.wisc.edu
Tue Aug 23 18:07:13 CEST 2005


FUJITA Tomonori wrote:
> From: Mike Christie <michaelc at cs.wisc.edu>
> Subject: [Stgt-devel] [PATCH] add stgt_device_template example
> Date: Tue, 23 Aug 2005 00:59:16 -0500
> 
> 
>>This adds the beginings of a stgt_device_template for
>>passthrough commands. It will end up using the block
>>layer BLOCK_PC facility to pass the command to the
>>underlying device similar to how we do it for SG_IO
>>and dm-multipath hw_handlers like dm-emc.c.
>>
>>It is not completely hooked in yet. The command
>>handling needs to be done and so does the actual
>>device creation.
>>
>>This was built over my last patch.
> 
> 
> The patch to fix memory leak.
> 
> diff -x CVS -x .svn -x GPATH -x GRTAGS -x GSYMS -x GTAGS -x .config -u --new-file --recursive stgt.vsd/kernel/stgt_sd.c stgt.work/kernel/stgt_sd.c
> --- stgt.vsd/kernel/stgt_sd.c	2005-08-23 23:47:50.000000000 +0900
> +++ stgt.work/kernel/stgt_sd.c	2005-08-24 00:45:16.000000000 +0900
> @@ -71,10 +71,6 @@
>  	if (err)
>  		return err;
>  
> -	sddev = kmalloc(sizeof(*sddev), GFP_KERNEL);
> -	if (!sddev)
> -		return -ENOMEM;

oops again. I moved the allocation to allow stgt_core do it
but forgot to remove this. thanks

> -
>  	err = open_dev(sddev, devt);
>  	if (err)
>  		goto free_sddev;
> _______________________________________________
> Stgt-devel mailing list
> Stgt-devel at lists.berlios.de
> http://lists.berlios.de/mailman/listinfo/stgt-devel




More information about the stgt mailing list