Message ID | 1553234834-69720-1-git-send-email-fei.yang@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v4] usb: gadget: f_fs: don't free buffer prematurely | expand |
diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 20413c2..0bce731 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1133,7 +1133,8 @@ static ssize_t ffs_epfile_io(struct file *file, struct ffs_io_data *io_data) error_mutex: mutex_unlock(&epfile->mutex); error: - ffs_free_buffer(io_data); + if (data) /* don't free if there is iocb queued */ + ffs_free_buffer(io_data); return ret; }