ieee1394: csr1212: proper refcounting
At least since nodemgr got rid of coarse global locking, accesses to struct csr1212_keyval's reference counter should be atomic and coupled with proper barriers. Also, calls to csr1212_keep_keyval(kv) should occur before kv is being used. (We probably should convert refcnt to struct kref, but how to keep csr1212_destroy_keyval's implementation non-recursively then?) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
@ -1014,13 +1014,13 @@ static struct unit_directory *nodemgr_process_unit_directory
|
||||
CSR1212_TEXTUAL_DESCRIPTOR_LEAF_LANGUAGE(kv) == 0) {
|
||||
switch (last_key_id) {
|
||||
case CSR1212_KV_ID_VENDOR:
|
||||
ud->vendor_name_kv = kv;
|
||||
csr1212_keep_keyval(kv);
|
||||
ud->vendor_name_kv = kv;
|
||||
break;
|
||||
|
||||
case CSR1212_KV_ID_MODEL:
|
||||
ud->model_name_kv = kv;
|
||||
csr1212_keep_keyval(kv);
|
||||
ud->model_name_kv = kv;
|
||||
break;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user