diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-12-10 17:50:58 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2017-02-03 09:19:41 -0200 |
commit | 6e531f104cddff0385393819f84c61cc552faab5 (patch) | |
tree | f2ba0463786c07eaa5c93c0b57ab3f7ea0562c8f /drivers/media | |
parent | d2180e0cf77dc7a7049671d5d57dfa0a228f83c1 (diff) |
[media] bt8xx: Delete two error messages for a failed memory allocation
Omit extra messages for a memory allocation failure in two functions.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/pci/bt8xx/dst_ca.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/pci/bt8xx/dst_ca.c b/drivers/media/pci/bt8xx/dst_ca.c index 8681b9143a35..54e656ddd588 100644 --- a/drivers/media/pci/bt8xx/dst_ca.c +++ b/drivers/media/pci/bt8xx/dst_ca.c @@ -481,10 +481,9 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer; int result = 0; - if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { - dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); + hw_buffer = kmalloc(sizeof(*hw_buffer), GFP_KERNEL); + if (!hw_buffer) return -ENOMEM; - } dprintk(verbose, DST_CA_DEBUG, 1, " "); if (copy_from_user(p_ca_message, arg, sizeof (struct ca_msg))) { @@ -567,7 +566,6 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL); p_ca_caps = kmalloc(sizeof (struct ca_caps), GFP_KERNEL); if (!p_ca_message || !p_ca_slot_info || !p_ca_caps) { - dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); result = -ENOMEM; goto free_mem_and_exit; } |