mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Devendra Naga <devendra.aaru@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging/sbe-2t3e3: error path cleanup in t3e3_init_channel
Date: Thu, 19 Jul 2012 15:50:38 +0300	[thread overview]
Message-ID: <20120719125038.GC16291@mwanda> (raw)
In-Reply-To: <1342701001-5424-1-git-send-email-devendra.aaru@gmail.com>

Cleanup means there are no behavior changes.  This is a bug fix.

On Thu, Jul 19, 2012 at 06:00:01PM +0530, Devendra Naga wrote:
>     a) if alloc_hdlcdev fails, we are going into the free_regions,
> and returning out the err (which is 0 by the prev call),
>        return -ENOMEM if this function fail.
> 
>     b) setup_device also can fail, as it calls around the register_hdlc_dev which
> is again a macro of the register_netdev.
> 
>        take the error from the setup_device and return it out in error condition
> 
>     c) request_irq when fails, we are freeing requested mem regions and disabling
> the pci device(?) and returning err which is agian 0 here.
> 
>       take the error from request_irq and err path will take care of returning it.
> 
> as if we return 0 , at the init function, t3e3_init_card, we have a success case
> and if there are two channels we call this function again, having the result of
> it completely unknown.
> 
> This result in having the probe return 0, unloading the driver may (not) cause
> ambigous result.

These bugs were there before your patch, but we should also be doing
an unregister_hdlc_device() and a free_netdev().

regards,
dan carpenter


  reply	other threads:[~2012-07-19 12:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 12:30 Devendra Naga
2012-07-19 12:50 ` Dan Carpenter [this message]
2012-07-19 13:03   ` devendra.aaru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120719125038.GC16291@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=devendra.aaru@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome