Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60b146e3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi-dev: Fix NULL error check"

parents dd003258 e793a637
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
// 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;