devendra.aaru | 21 Jun 2012 06:41
Picon

Re: Q: NET/JME: pci_get_drvdata pointer return check at jme_remove

Hi Ben,

On Thu, Jun 21, 2012 at 2:00 AM, Ben Hutchings
<bhutchings <at> solarflare.com> wrote:
> On Wed, 2012-06-20 at 22:50 +0530, devendra.aaru wrote:
>> Hi,
>>
>> looking at the jme_init_one error path, the context of the driver data
>> is set to null.
>>
>> If the driver unloads , the unload _remove_one, will be called and
>> deferencing the pointer, leading to a oops.
>>
>> so we need to have a check at before doing the netdev_priv at remove_one.
>>
>> Please correct me if my understanding is wrong....
>
> If a driver probe function fails for some device (i.e. its return value
> is negative), its remove function is *not* called for that device.
>
Oh, Thanks for the information, really i m a noob. i will not ask this
q's until i read some more things about the kernel and device driver
layers.
> Ben.
>
> --
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.
>
(Continue reading)


Gmane