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

Commit b70b4ad0 authored by Jeya R's avatar Jeya R
Browse files

msm: adsprpc: null pointer check for fl



Adding a null pointer check for fl before
dereferencing.

Change-Id: I384e9f3980cf8c42cb2eeb554cc3c1e38c3520c0
Acked-by: default avatarKrishnaiah Tadakamalla <ktadakam@qti.qualcomm.com>
Signed-off-by: default avatarJeya R <jeyr@codeaurora.org>
parent d62dd07f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
/*
 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012-2021, 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
@@ -735,7 +735,9 @@ static void fastrpc_mmap_free(struct fastrpc_mmap *map, uint32_t flags)
	if (!map)
		return;
	fl = map->fl;
	if (fl && !(map->flags == ADSP_MMAP_HEAP_ADDR ||
	if (!fl)
		return;
	if (!(map->flags == ADSP_MMAP_HEAP_ADDR ||
				map->flags == ADSP_MMAP_REMOTE_HEAP_ADDR)) {
		cid = fl->cid;
		VERIFY(err, cid >= ADSP_DOMAIN_ID && cid < NUM_CHANNELS);
@@ -3738,6 +3740,11 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int ioctl_num,
	int size = 0, err = 0;
	uint32_t info;

	VERIFY(err, fl != NULL);
	if (err) {
		err = -EBADR;
		goto bail;
	}
	p.inv.fds = NULL;
	p.inv.attrs = NULL;
	p.inv.crc = NULL;