kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] staging: wilc1000: NULL dereference on error
@ 2016-07-16 10:07 Dan Carpenter
  2016-07-16 10:19 ` walter harms
  2016-07-16 10:57 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-07-16 10:07 UTC (permalink / raw)
  To: kernel-janitors

We can't pass NULL pointers to destroy_workqueue().

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0b1760c..78f524f 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3363,7 +3363,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 		if (!hif_workqueue) {
 			netdev_err(vif->ndev, "Failed to create workqueue\n");
 			result = -ENOMEM;
-			goto _fail_mq_;
+			goto _fail_;
 		}
 
 		setup_timer(&periodic_rssi, GetPeriodicRSSI,
@@ -3391,7 +3391,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
 
 	clients_count++;
 
-_fail_mq_:
 	destroy_workqueue(hif_workqueue);
 _fail_:
 	return result;

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

* Re: [patch] staging: wilc1000: NULL dereference on error
  2016-07-16 10:07 [patch] staging: wilc1000: NULL dereference on error Dan Carpenter
@ 2016-07-16 10:19 ` walter harms
  2016-07-16 10:57 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: walter harms @ 2016-07-16 10:19 UTC (permalink / raw)
  To: kernel-janitors



Am 16.07.2016 12:07, schrieb Dan Carpenter:
> We can't pass NULL pointers to destroy_workqueue().
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 0b1760c..78f524f 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -3363,7 +3363,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
>  		if (!hif_workqueue) {
>  			netdev_err(vif->ndev, "Failed to create workqueue\n");
>  			result = -ENOMEM;
> -			goto _fail_mq_;
> +			goto _fail_;
>  		}
>  


maybe this is the point where return -ENOMEM; is the most simple solution ?

re,
 wh


>  		setup_timer(&periodic_rssi, GetPeriodicRSSI,
> @@ -3391,7 +3391,6 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
>  
>  	clients_count++;
>  
> -_fail_mq_:
>  	destroy_workqueue(hif_workqueue);
>  _fail_:
>  	return result;
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

* Re: [patch] staging: wilc1000: NULL dereference on error
  2016-07-16 10:07 [patch] staging: wilc1000: NULL dereference on error Dan Carpenter
  2016-07-16 10:19 ` walter harms
@ 2016-07-16 10:57 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-07-16 10:57 UTC (permalink / raw)
  To: kernel-janitors

On Sat, Jul 16, 2016 at 12:19:03PM +0200, walter harms wrote:
> 
> 
> Am 16.07.2016 12:07, schrieb Dan Carpenter:
> > We can't pass NULL pointers to destroy_workqueue().
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> > index 0b1760c..78f524f 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -3363,7 +3363,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
> >  		if (!hif_workqueue) {
> >  			netdev_err(vif->ndev, "Failed to create workqueue\n");
> >  			result = -ENOMEM;
> > -			goto _fail_mq_;
> > +			goto _fail_;
> >  		}
> >  
> 
> 
> maybe this is the point where return -ENOMEM; is the most simple solution ?

Yeah.  This code is staging quality.  There are lots of other cleanups
someone could do.  Later patches...

regards,
dan carpenter


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

end of thread, other threads:[~2016-07-16 10:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-16 10:07 [patch] staging: wilc1000: NULL dereference on error Dan Carpenter
2016-07-16 10:19 ` walter harms
2016-07-16 10:57 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).