mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Possible SCSI (sr) mini-cleanup
@ 2002-05-07 20:50 Thunder from the hill
  2002-05-07 22:02 ` Andreas Dilger
  0 siblings, 1 reply; 4+ messages in thread
From: Thunder from the hill @ 2002-05-07 20:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

I don't see where the variable and the label have been used. Are they 
useful for anything? If they are, tell me please!

							       Regards,
								Thunder

diff -Nur linus-2.5/drivers/scsi/sr.c thunder-2.5/drivers/scsi/sr.c
--- linus-2.5/drivers/scsi/sr.c	Tue May  7 14:28:57 2002
+++ thunder-2.5/drivers/scsi/sr.c	Tue May  7 14:27:10 2002
@@ -697,8 +697,6 @@
 
 static int sr_init()
 {
-	int i;
-
 	if (sr_template.dev_noticed == 0)
 		return 0;
 
@@ -723,8 +721,6 @@
 		goto cleanup_cds;
 	memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));
 	return 0;
-cleanup_sizes:
-	kfree(sr_sizes);
 cleanup_cds:
 	kfree(scsi_CDs);
 cleanup_devfs:
-- 
if (errno == ENOTAVAIL)
    fprintf(stderr, "Error: Talking to Microsoft server!\n");


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

* Re: [PATCH] Possible SCSI (sr) mini-cleanup
  2002-05-07 20:50 [PATCH] Possible SCSI (sr) mini-cleanup Thunder from the hill
@ 2002-05-07 22:02 ` Andreas Dilger
  2002-05-07 22:12   ` David Weinehall
  2002-05-07 22:39   ` Thunder from the hill
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Dilger @ 2002-05-07 22:02 UTC (permalink / raw)
  To: Thunder from the hill; +Cc: Linux Kernel Mailing List

On May 07, 2002  14:50 -0600, Thunder from the hill wrote:
> I don't see where the variable and the label have been used. Are they 
> useful for anything? If they are, tell me please!

> @@ -723,8 +721,6 @@
>  		goto cleanup_cds;
>  	memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));
>  	return 0;
> -cleanup_sizes:
> -	kfree(sr_sizes);
>  cleanup_cds:
>  	kfree(scsi_CDs);
>  cleanup_devfs:

Note that you are also removing the "kfree(sr_sizes)" which is
definitely used...

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/


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

* Re: [PATCH] Possible SCSI (sr) mini-cleanup
  2002-05-07 22:02 ` Andreas Dilger
@ 2002-05-07 22:12   ` David Weinehall
  2002-05-07 22:39   ` Thunder from the hill
  1 sibling, 0 replies; 4+ messages in thread
From: David Weinehall @ 2002-05-07 22:12 UTC (permalink / raw)
  To: Thunder from the hill, Linux Kernel Mailing List

On Tue, May 07, 2002 at 04:02:35PM -0600, Andreas Dilger wrote:
> On May 07, 2002  14:50 -0600, Thunder from the hill wrote:
> > I don't see where the variable and the label have been used. Are they 
> > useful for anything? If they are, tell me please!
> 
> > @@ -723,8 +721,6 @@
> >  		goto cleanup_cds;
> >  	memset(sr_sizes, 0, sr_template.dev_max * sizeof(int));
> >  	return 0;
> > -cleanup_sizes:
> > -	kfree(sr_sizes);
> >  cleanup_cds:
> >  	kfree(scsi_CDs);
> >  cleanup_devfs:
> 
> Note that you are also removing the "kfree(sr_sizes)" which is
> definitely used...

There's a return 0 on the line before the kfree(sr_sizes);,
so either there is a goto cleanup_sizes somewhere, or the code is dead.

Regards: David Weinehall
  _                                                                 _
 // David Weinehall <tao@acc.umu.se> /> Northern lights wander      \\
//  Maintainer of the v2.0 kernel   //  Dance across the winter sky //
\>  http://www.acc.umu.se/~tao/    </   Full colour fire           </

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

* Re: [PATCH] Possible SCSI (sr) mini-cleanup
  2002-05-07 22:02 ` Andreas Dilger
  2002-05-07 22:12   ` David Weinehall
@ 2002-05-07 22:39   ` Thunder from the hill
  1 sibling, 0 replies; 4+ messages in thread
From: Thunder from the hill @ 2002-05-07 22:39 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Thunder from the hill, Linux Kernel Mailing List

Hi,

On Tue, 7 May 2002, Andreas Dilger wrote:
> >  	return 0;
> > -cleanup_sizes:
> > -	kfree(sr_sizes);
> 
> Note that you are also removing the "kfree(sr_sizes)" which is
> definitely used...

Definitely not. If it's better to kfree(sr_sizes), we should move that 
_before_ the return.

							       Regards,
								Thunder
-- 
if (errno == ENOTAVAIL)
    fprintf(stderr, "Error: Talking to Microsoft server!\n");


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

end of thread, other threads:[~2002-05-07 22:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-07 20:50 [PATCH] Possible SCSI (sr) mini-cleanup Thunder from the hill
2002-05-07 22:02 ` Andreas Dilger
2002-05-07 22:12   ` David Weinehall
2002-05-07 22:39   ` Thunder from the hill

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®