mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
Merge "msm: mhi_dev: Avoiding null pointer dereference in uci layer"
This commit is contained in:
commit
582043ac51
1 changed files with 5 additions and 6 deletions
|
|
@ -1081,17 +1081,16 @@ static int mhi_uci_client_open(struct inode *mhi_inode,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!uci_handle) {
|
||||
uci_log(UCI_DBG_DBG, "No memory, returning failure\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mutex_lock(&uci_handle->client_lock);
|
||||
uci_log(UCI_DBG_DBG,
|
||||
"Client opened struct device node 0x%x, ref count 0x%x\n",
|
||||
iminor(mhi_inode), atomic_read(&uci_handle->ref_count));
|
||||
if (atomic_add_return(1, &uci_handle->ref_count) == 1) {
|
||||
if (!uci_handle) {
|
||||
atomic_dec(&uci_handle->ref_count);
|
||||
uci_log(UCI_DBG_DBG, "No memory, returning failure\n");
|
||||
mutex_unlock(&uci_handle->client_lock);
|
||||
return -ENOMEM;
|
||||
}
|
||||
uci_handle->uci_ctxt = &uci_ctxt;
|
||||
uci_handle->f_flags = file_handle->f_flags;
|
||||
if (!atomic_read(&uci_handle->mhi_chans_open)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue