[Stgt-devel] [PATCH] add stgt_device_template example

FUJITA Tomonori tomof at acm.org
Tue Aug 23 18:00:15 CEST 2005


From: FUJITA Tomonori <tomof at acm.org>
Subject: Re: [Stgt-devel] [PATCH] add stgt_device_template example
Date: Wed, 24 Aug 2005 00:47:40 +0900

> > 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.

Oops, it's incomplete. Try again.

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:58:01.000000000 +0900
@@ -71,19 +71,11 @@
 	if (err)
 		return err;
 
-	sddev = kmalloc(sizeof(*sddev), GFP_KERNEL);
-	if (!sddev)
-		return -ENOMEM;
-
 	err = open_dev(sddev, devt);
 	if (err)
-		goto free_sddev;
+		return err;
 
 	return 0;
-
-free_sddev:
-	kfree(sddev);
-	return err;
 }
 
 static void stgt_sd_destroy(struct stgt_device *device)



More information about the stgt mailing list