]> git.baikalelectronics.ru Git - kernel.git/commit
block: bsg: move atomic_t ref_count variable to refcount API
authorJohn Pittman <jpittman@redhat.com>
Mon, 27 Aug 2018 18:33:05 +0000 (14:33 -0400)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Aug 2018 01:17:02 +0000 (19:17 -0600)
commit1fd4a37a275d0b14199e047c5f61caa78f74dd32
tree5ebcc8fb74104392763ba3a03eae0196f19ea6cd
parent653fbb0b9314c29bf0af862f6940d867f001e045
block: bsg: move atomic_t ref_count variable to refcount API

Currently, variable ref_count within the bsg_device struct is of
type atomic_t.  For variables being used as reference counters,
the refcount API should be used instead of atomic.  The newer
refcount API works to prevent counter overflows and use-after-free
bugs.  So, move this varable from the atomic API to refcount,
potentially avoiding the issues mentioned.

Signed-off-by: John Pittman <jpittman@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bsg.c