Change-Id: I3d4553da9cd50ebd8300a917d37d94e29bf2fcc2
Signed-off-by: Alexander Aksenov <a.aksenov@samsung.com>
m->len = size;
- if (swap_buffer_write(m, SWAP_MSG_PRIV_DATA + size)) {
+ if (swap_buffer_write(m, SWAP_MSG_PRIV_DATA + size) !=
+ (SWAP_MSG_PRIV_DATA + size)) {
atomic_inc(&discarded);
return -EINVAL;
}
m->seq_num = atomic_inc_return(&seq_num);
/* TODO: What should be returned?! When message was discarded. */
- if (swap_buffer_write(m, size))
+ if (swap_buffer_write(m, size) != size)
atomic_inc(&discarded);
return size;