Commit 582f445f authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: storvsc: Prevent outgoing traffic when stor dev is being destroyed

Prevent outgoing traffic when stor dev is destroyed.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f6c17484
......@@ -294,7 +294,8 @@ static inline struct storvsc_device *get_out_stor_device(
struct storvsc_device *stor_device;
stor_device = (struct storvsc_device *)device->ext;
if (stor_device && atomic_read(&stor_device->ref_count) > 1)
if (stor_device && (atomic_read(&stor_device->ref_count) > 1) &&
!stor_device->destroy)
atomic_inc(&stor_device->ref_count);
else
stor_device = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment