scsi host refcounting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm hot on the trail of how adding a SCSI LLD in the kernel works, but i 
seem to have lost my bearings.

in the scsi_add_host_with_dma() procedure, it device_add()s shost_gendev 
which has the side effect of incrementing the kobj refcount of its 
parent. in my case, its a pci_dev.dev. a few lines after, it calls 
get_device(shost->shost_gendev.parent); which would _also_ increment the 
parent refcount. shouldn't it just do a single bump instead of two? see 
snip below:

-- snip --
     error = device_add(&shost->shost_gendev);
     if (error)
         goto out;

.......

     scsi_host_set_state(shost, SHOST_RUNNING);
     get_device(shost->shost_gendev.parent);
-- snip --

I'm just ocularly following the codes right now so i might have missed a 
device_put on the parent somewhere. please enlighten me on this.

regards


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux