diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-10-13 11:34:29 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-11-18 15:50:19 +0300 |
commit | fac59136bc22fd9b3a04ed4f29977da8e045ee6b (patch) | |
tree | 3917f7db52f19816330a19923ccf61ab43ec140e | |
parent | 576df632f24f7db40b7266cada96ed1b76f1255d (diff) | |
download | linux-fac59136bc22fd9b3a04ed4f29977da8e045ee6b.tar.xz |
[media] RedRat3: Return directly after a failed kcalloc() in redrat3_transmit_ir()
* Return directly after a call of the function "kcalloc" failed
at the beginning.
* Reorder two calls for the function "kfree" at the end.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/rc/redrat3.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index 342a85d02887..966f43a7e2c2 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -777,10 +777,8 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, sample_lens = kcalloc(RR3_DRIVER_MAXLENS, sizeof(*sample_lens), GFP_KERNEL); - if (!sample_lens) { - ret = -ENOMEM; - goto out; - } + if (!sample_lens) + return -ENOMEM; irdata = kzalloc(sizeof(*irdata), GFP_KERNEL); if (!irdata) { @@ -848,8 +846,8 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, ret = count; out: - kfree(sample_lens); kfree(irdata); + kfree(sample_lens); rr3->transmitting = false; /* rr3 re-enables rc detector because it was enabled before */ |