drbd: Protect accesses to the uuid set with a spinlock
A message that is not in the archive (sent off-list or not yet received): [email protected]
Philipp Reisner
maintainerHi Dan,
Thanks for the report. I have removed the redundant check. See here:
Best regards,
Phil
Quoted 30 lines
Hello Philipp Reisner,
This is a semi-automatic email about new static checker warnings.
The patch
9f2247bb9b75: "drbd: Protect accesses to the uuid set with a spinlock" from Aug 16, 2012, leads to the following Smatch complaint:
drivers/block/drbd/drbd_main.c:843_drbd_send_uuids()warn: variable dereferenced before check 'mdev->ldev' (see line 841)
drivers/block/drbd/drbd_main.c
840 }841 spin_lock_irq(&mdev->ldev->md.uuid_lock); ^^^^^^^^^^^^^New dereference.
842 for (i = UI_CURRENT; i < UI_SIZE; i++) 843 p->uuid[i] = mdev->ldev ? cpu_to_be64(mdev->ldev->md.uuid[i]) : 0; ^^^^^^^^^^Old check.
844 spin_unlock_irq(&mdev->ldev->md.uuid_lock); ^^^^^^^^^^^^New dereference.
845regards,
dan carpenter