Re: [PATCH v4 4/9] misc: amd-sbi: Add support for AMD_SBI IOCTL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 12, 2024 at 07:08:05AM +0000, Akshay Gupta wrote:
> +	switch (msg.cmd) {
> +	case 0 ... 0x999:
> +		/* Mailbox protocol */
> +		ret = rmi_mailbox_xfer(data, &msg);
> +		break;
> +	default:
> +		pr_err("Command:0x%x not recognized\n", msg.cmd);

You now just allowed userspace to spam the kernel logs for no good
reason :(

Also, always use dev_*() calls in a driver, not pr_*() ones, as then you
will know exactly what driver/device is sending out the message.

> +		break;

And you returned the wrong error code if this happens :(

greg k-h




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux