kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* scsi host refcounting
@ 2012-02-19  9:24 nil acuna
  0 siblings, 0 replies; only message in thread
From: nil acuna @ 2012-02-19  9:24 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-02-19  9:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19  9:24 scsi host refcounting nil acuna

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).