We don't allow to seek in the debugfs socket and log files. Thus we
should mark the file descriptor as nonseekable.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
static int log_open(struct inode *inode, struct file *file)
{
+ nonseekable_open(inode, file);
file->private_data = inode->i_private;
inc_module_count();
return 0;
.release = log_release,
.read = log_read,
.poll = log_poll,
+ .llseek = no_llseek,
};
static int debug_log_setup(struct bat_priv *bat_priv)
unsigned int i;
struct socket_client *socket_client;
+ nonseekable_open(inode, file);
+
socket_client = kmalloc(sizeof(struct socket_client), GFP_KERNEL);
if (!socket_client)
.read = bat_socket_read,
.write = bat_socket_write,
.poll = bat_socket_poll,
+ .llseek = no_llseek,
};
int bat_socket_setup(struct bat_priv *bat_priv)