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

Commit b0c51c80 authored by Vasantha Balla's avatar Vasantha Balla Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Check ion_handle for errors



When ion imports dma buf, it will return negative error number
in the case of failure like bad file number or invalid dma buf file.
check ion_handle for error numbers.

Change-Id: I1ea93161b85deb667cbb6f8515ff7c6943da6e3d
Signed-off-by: default avatarKarthikeyan Periasamy <kperiasa@codeaurora.org>
Signed-off-by: default avatarVasantha Balla <vballa@codeaurora.org>
parent 851ed4aa
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -476,7 +476,8 @@ bool msm_smem_compare_buffers(void *clt, int fd, void *priv)
	}
	handle = ion_import_dma_buf_fd(client->clnt, fd);
	ret = handle == priv;
	handle ? ion_free(client->clnt, handle) : 0;
	if (!IS_ERR_OR_NULL(handle))
		ion_free(client->clnt, handle);
	return ret;
}