Anderson Briglia wrote:
> Russell King wrote:
>
>
>>On Mon, Jan 09, 2006 at 06:16:02PM -0400, Anderson Briglia wrote:
>>
>>
>>
>>>+ dev = bus_find_device(&mmc_bus_type, NULL, NULL, mmc_match_lockable);
>>>+ if (!dev)
>>>+ goto error;
>>>+ card = dev_to_mmc_card(dev);
>>>+
>>>+ if (operation == KEY_OP_INSTANTIATE) { /* KEY_OP_INSTANTIATE */
>>>+ if (mmc_card_locked(card)) {
>>>+ ret = mmc_lock_unlock(card, key, MMC_LOCK_MODE_UNLOCK);
>>>+ mmc_remove_card(card);
>>>+ mmc_register_card(card);
>>>+ }
>>>+ else
>>>+ ret = mmc_lock_unlock(card, key, MMC_LOCK_MODE_SET_PWD);
>>>
>
>>Also, removing and re-registering a card is an offence. These
>>things are ref-counted, and mmc_remove_card() will drop the last
>>reference - so the memory associated with it will be freed. Then
>>you re-register it. Whoops.
>>
>>If you merely want to try to attach a driver, use device_attach()
>>instead.
>>
We changed the mmc_remove_card() and mmc_register_card() by device_release_driver() and
device_attach(), supposedly avoiding ref-counts issues.
Regards,
Anderson Briglia
INdT - Manaus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]