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

Commit 547129b6 authored by Kamal Agrawal's avatar Kamal Agrawal Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Avoid flooding kernel log with invalid ioctl errors



For invalid ioctl inputs from user, kgsl already returns -ENOIOCTLCMD error
code. Avoid flooding kernel log with such errors.

Change-Id: Iaf9c8eb0c51b221738482e2b4b02289913a2878e
Signed-off-by: default avatarKamal Agrawal <kamaagra@codeaurora.org>
parent b794964c
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2002,2007-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2002,2007-2021, The Linux Foundation. All rights reserved.
 */

#include <linux/slab.h>
@@ -183,11 +183,8 @@ long adreno_ioctl_helper(struct kgsl_device_private *dev_priv,
			break;
	}

	if (i == len) {
		dev_err(dev_priv->device->dev,
			     "invalid ioctl code 0x%08X\n", cmd);
	if (i == len)
		return -ENOIOCTLCMD;
	}

	if (_IOC_SIZE(cmds[i].cmd > sizeof(data))) {
		dev_err_ratelimited(dev_priv->device->dev,
+1 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
 */

#include "kgsl_device.h"
@@ -384,8 +384,6 @@ long kgsl_compat_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
	if (ret == -ENOIOCTLCMD) {
		if (device->ftbl->compat_ioctl != NULL)
			return device->ftbl->compat_ioctl(dev_priv, cmd, arg);

		dev_err(device->dev, "invalid ioctl code 0x%08X\n", cmd);
	}

	return ret;
+1 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2008-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
 */

#include "kgsl_device.h"
@@ -181,8 +181,6 @@ long kgsl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
			return device->ftbl->compat_ioctl(dev_priv, cmd, arg);
		else if (device->ftbl->ioctl != NULL)
			return device->ftbl->ioctl(dev_priv, cmd, arg);

		dev_err(device->dev, "invalid ioctl code 0x%08X\n", cmd);
	}

	return ret;