Message ID | 1287147610-8041-1-git-send-email-julia@diku.dk |
---|---|
State | Awaiting Upstream, archived |
Delegated to: | David Miller |
Headers | show |
Hi Julia, On Fri, 2010-10-15 at 15:00 +0200, Julia Lawall wrote: > From: Julia Lawall <julia@diku.dk> > > In this code, 0 is returned on memory allocation failure, even though other > failures return -ENOMEM or other similar values. > > The initial value of ret as 0 is never used, so drop the initialization. Thanks, patch applied to my irda-2.6 tree. Cheers, Samuel. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff -u -p a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c --- a/drivers/net/irda/irtty-sir.c +++ b/drivers/net/irda/irtty-sir.c @@ -426,7 +426,7 @@ static int irtty_open(struct tty_struct { struct sir_dev *dev; struct sirtty_cb *priv; - int ret = 0; + int ret; /* Module stuff handled via irda_ldisc.owner - Jean II */ @@ -459,8 +459,10 @@ static int irtty_open(struct tty_struct /* allocate private device info block */ priv = kzalloc(sizeof(*priv), GFP_KERNEL); - if (!priv) + if (!priv) { + ret = -ENOMEM; goto out_put; + } priv->magic = IRTTY_MAGIC; priv->tty = tty;