This looks correct and safe to me, but I wonder if anyone relies on multi-threaded /dev/sg write usage, which would be completely serialized with this.
- [PATCH] scsi: sg: Prevent potential double frees in sg d... Nick Desaulniers
- Re: [PATCH] scsi: sg: Prevent potential double free... Greg KH
- Re: [PATCH] scsi: sg: Prevent potential double ... Nick Desaulniers
- Re: [PATCH] scsi: sg: Prevent potential double free... Christoph Hellwig

