PD#SWPL-13973
Problem:
irblaster Coverity errors.
Solution:
1. Properly release resources.
2. Fix return value type.
Verify:
test pass on g12a_u200_v1
Change-Id: I50054ba3ac9f02aeeaa005b7823416b1c4c9a196
Signed-off-by: Bichao Zheng <bichao.zheng@amlogic.com>
unsigned int commmand,
unsigned int *data)
{
- u32 raw, ret;
+ int ret;
+ u32 raw;
if (protocol >= IRBLASTER_PROTOCOL_MAX)
return -ENODEV;
int irblaster_rca_encode(enum irblaster_protocol protocol, unsigned int addr,
unsigned int commmand, unsigned int *data)
{
- u32 raw, ret;
+ int ret;
+ u32 raw;
/* Convert a RCA scancode to raw rca data */
raw = irblaster_rca_scancode_to_raw(protocol, addr, commmand);
if (ret) {
pr_err("Invalid tone\n");
mutex_unlock(&chip->sys_lock);
+ kfree(buffer);
return ret;
}
buffer[m] = val * 10;