davidker / unisys

Master repository for new changes to drivers/staging/unisys and drivers/visorbus
Other
2 stars 1 forks source link

visornic: double-unlock reported by smatch #25

Closed selltc closed 8 years ago

selltc commented 8 years ago

See KanBoard 806 - http://ustr-erl-6690.na.uis.unisys.com/?controller=task&action=show&task_id=806&project_id=37

drivers/staging/unisys/visornic/visornic_main.c:377 visornic_serverdown() error: double unlock 'spin_lock:&devdata->priv_lock'
drivers/staging/unisys/visornic/visornic_main.c:377 visornic_serverdown() error: double unlock 'irqsave:flags'

This was originally discussed in #24, but Neil agreed that we can fix the immediate problem involving the double-unlock while in staging, and queue the priv_lock removal (#24) until after we get out of staging.

selltc commented 8 years ago

Fixed with commit de15885d836d80f73c06da85a973bb751af7aeff.

I unit-tested by adding some messages to visornic_serverdown(), then forcing us thru IO service partition recovery, and ensured I got thru there. I hit Trac-7234 (https://ustr-svn-1.na.uis.unisys.com/trac/spar/ticket/7234) on the resume path, but that was to be expected.

checkpatch and regression test were clean.

davidker commented 8 years ago

Tim, I'm having a problem understanding this comment:

Previously, devdata->priv_lock was being unlocked in visornic_serverdown()
both before calling visornic_serverdown(), then again at the end of the
function.  This bug was corrected.
selltc commented 8 years ago

Doh!

_both before calling visornicserverdown() --> _both before calling visornic_serverdown_complete()_

Does that make more sense?

selltc commented 8 years ago

This is commit 4145ba76b1f7f3296cc673c299084145e1267029 in the upstream.