Commit 8225161545a67bdb68cf86beafcdce1604720605
1 parent
5676864431
netfilter: nfnetlink_log: remove unnecessary error messages
In case of OOM, there's nothing userspace can do. If there's no room to put the payload in __build_packet_message(), jump to nla_put_failure which already performs the corresponding error reporting. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Showing 1 changed file with 2 additions and 7 deletions Side-by-side Diff
net/netfilter/nfnetlink_log.c
... | ... | @@ -334,9 +334,6 @@ |
334 | 334 | |
335 | 335 | skb = nfnetlink_alloc_skb(net, pkt_size, |
336 | 336 | peer_portid, GFP_ATOMIC); |
337 | - if (!skb) | |
338 | - pr_err("nfnetlink_log: can't even alloc %u bytes\n", | |
339 | - pkt_size); | |
340 | 337 | } |
341 | 338 | } |
342 | 339 | |
... | ... | @@ -568,10 +565,8 @@ |
568 | 565 | struct nlattr *nla; |
569 | 566 | int size = nla_attr_size(data_len); |
570 | 567 | |
571 | - if (skb_tailroom(inst->skb) < nla_total_size(data_len)) { | |
572 | - printk(KERN_WARNING "nfnetlink_log: no tailroom!\n"); | |
573 | - return -1; | |
574 | - } | |
568 | + if (skb_tailroom(inst->skb) < nla_total_size(data_len)) | |
569 | + goto nla_put_failure; | |
575 | 570 | |
576 | 571 | nla = (struct nlattr *)skb_put(inst->skb, nla_total_size(data_len)); |
577 | 572 | nla->nla_type = NFULA_PAYLOAD; |