/*
* netsniff-ng - the packet sniffing beast
* Copyright 2014 Tobias Klauser.
* Subject to the GPL, version 2.
*/
#include "dissector.h"
#include "dissector_netlink.h"
static inline void dissector_init_entry(int type)
{
dissector_set_print_type(&nlmsg_ops, type);
}
static inline void dissector_init_exit(int type)
{
dissector_set_print_type(&none_ops, type);
}
void dissector_init_netlink(int fnttype)
{
dissector_init_entry(fnttype);
dissector_init_exit(fnttype);
}
void dissector_cleanup_netlink(void)
{
}
-next.git' title='net-next.git Git repository'/>
iio: maxim_thermocouple: detect invalid storage size in read()
As found by gcc -Wmaybe-uninitialized, having a storage_bytes value other
than 2 or 4 will result in undefined behavior:
drivers/iio/temperature/maxim_thermocouple.c: In function 'maxim_thermocouple_read':
drivers/iio/temperature/maxim_thermocouple.c:141:5: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
This probably cannot happen, but returning -EINVAL here is appropriate
and makes gcc happy and the code more robust.
Fixes: 231147ee77f3 ("iio: maxim_thermocouple: Align 16 bit big endian value of raw reads")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit 32cb7d27e65df9daa7cee8f1fdf7b259f214bee2)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>