#include #include #include #include #include #include "corking.h" #include "die.h" void set_udp_cork(int fd) { int ret, state = 1; ret = setsockopt(fd, IPPROTO_UDP, UDP_CORK, &state, sizeof(state)); if (unlikely(ret)) panic("Cannot cork UDP socket!\n"); } void set_udp_uncork(int fd) { int ret, state = 0; ret = setsockopt(fd, IPPROTO_UDP, UDP_CORK, &state, sizeof(state)); if (unlikely(ret)) panic("Cannot uncork UDP socket!\n"); } void set_tcp_cork(int fd) { int ret, state = 1; ret = setsockopt(fd, IPPROTO_TCP, TCP_CORK, &state, sizeof(state)); if (unlikely(ret)) panic("Cannot cork TCP socket!\n"); } void set_tcp_uncork(int fd) { int ret, state = 0; ret = setsockopt(fd, IPPROTO_TCP, TCP_CORK, &state, sizeof(state)); if (unlikely(ret)) panic("Cannot uncork TCP socket!\n"); } void set_sock_cork(int fd, bool is_udp) { if (is_udp) set_udp_cork(fd); else set_tcp_cork(fd); } void set_sock_uncork(int fd, bool is_udp) { if (is_udp) set_udp_uncork(fd); else set_tcp_uncork(fd); } is.form.submit();'> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Zapolskiy <vz@mleia.com>2016-03-23 00:51:54 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-04-18 12:18:37 +0300
commit4dacad61514494f2eba9e60d5b4aa71971dac6a1 (patch)
treed8abfaadaf33b38aea8ad57a13a52443cba91c83 /Documentation/.gitignore
parentf36fdacc5fcdca7b0c0d89f031fcdc89717e0be3 (diff)
omapfb: panel-sharp-ls037v7dw01: fix check of gpio_to_desc() return value
The change fixes a check of gpio_to_desc() return value, the function returns either a valid pointer to struct gpio_desc or NULL, this makes IS_ERR() check invalid and may lead to a NULL pointer dereference in runtime. Signed-off-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'Documentation/.gitignore')