提交 2f338c8a 编写于 作者: O Oliver Neukum 提交者: Greg Kroah-Hartman

USB: cdc-wdm: fix memory leak

cleanup() is not called if the last close() comes after
disconnect(). That leads to a memory leak. Rectified
by checking for an earlier disconnect() in release()
Signed-off-by: NOliver Neukum <oneukum@suse.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 24a85bae
......@@ -622,6 +622,8 @@ static int wdm_release(struct inode *inode, struct file *file)
kill_urbs(desc);
if (!test_bit(WDM_DISCONNECTING, &desc->flags))
desc->manage_power(desc->intf, 0);
else
cleanup(desc);
}
mutex_unlock(&wdm_mutex);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册