Re: [PATCH] Driver for IBM RSA service processor (2/2)

From: Francois Romieu
Date: Mon Feb 02 2004 - 17:18:35 EST


Max Asbock <masbock@xxxxxxxxxx> :
[...]
> diff -urN linux-2.6.1/drivers/misc/ibmasm/ibmasmfs.c linux-2.6.1-ibmasm/drivers/misc/ibmasm/ibmasmfs.c
> --- linux-2.6.1/drivers/misc/ibmasm/ibmasmfs.c 1969-12-31 16:00:00.000000000 -0800
> +++ linux-2.6.1-ibmasm/drivers/misc/ibmasm/ibmasmfs.c 2004-01-23 15:39:00.000000000 -0800
[...]
> +static int command_file_ioctl(struct inode *inode, struct file *file, unsigned int ioctl_cmd, unsigned long arg)
> +{
> + struct ibmasmfs_command_data *command_data = file->private_data;
> + struct command *cmd;
> + unsigned long flags;
> +
> + if (ioctl_cmd != IBMASM_IO_CANCEL)
> + return -ENOTTY;
> +
> + spin_lock_irqsave(&command_data->sp->lock, flags);
^^^^^^^^^^^^^^^^^
> + cmd = command_data->command;
> + if (cmd == NULL) {
> + spin_unlock_irqrestore(&command_data->sp->lock, flags);
> + return 0;
> + }
> + wake_up_interruptible(&cmd->wait);
> + spin_lock_irqsave(&command_data->sp->lock, flags);
^^^^^^^^^^^^^^^^^
> + return 0;

-> Typo ? What about:
[...]
spin_lock_irqsave(&command_data->sp->lock, flags);
cmd = command_data->command;
if (cmd == NULL)
goto out_unlock;
wake_up_interruptible(&cmd->wait);
out_unlock:
spin_unlock_irqrestore(&command_data->sp->lock, flags);
return 0;
}

--
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/