mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 15:11:48 -04:00
mhi-dev: Fix NULL error check
Memory allocation for MHI client channels is failing. Resolve it by fixing the conditional check for NULL pointer. Change-Id: I98a7fe085482116236703e3af69010bade0130b7 Signed-off-by: Gauri Joshi <gaurjosh@codeaurora.org>
This commit is contained in:
parent
b0fec7e6e2
commit
e793a637e2
1 changed files with 3 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/* Copyright (c) 2015,2017-2020, The Linux Foundation. All rights reserved.*/
|
||||
/* Copyright (c) 2015,2017-2021, The Linux Foundation. All rights reserved.*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -943,8 +943,9 @@ static int mhi_uci_client_open(struct inode *mhi_inode,
|
|||
"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 != NULL) {
|
||||
if (!uci_handle) {
|
||||
atomic_dec(&uci_handle->ref_count);
|
||||
uci_log(UCI_DBG_DBG, "No memory, returning failure\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
uci_handle->uci_ctxt = &uci_ctxt;
|
||||
|
|
|
|||
Loading…
Reference in a new issue