usb: f_diag: Replace ERROR with pr_err
Consider a case where cdev is freed from composite_dev_cleanup
before usb_diag_read is called when composition switch is
happening. In usb_diag_read the driver will go into error
path and print error statement using ERROR macro which is
dereferencing cdev(already freed) causing NULL pointer
dereference.
Fix this by replacing ERROR with pr_err in usb_diag_read
and usb_diag_write.
Change-Id: I651b4d7e17081813a9f3def181d59c08e9a1def5
Signed-off-by:
Pratham Pratap <prathampratap@codeaurora.org>
Loading
Please register or sign in to comment