Skip to contentSkip to conversation

GCC4 audit.c warning: no return statement in function

KJ Domen Puncer 1 participant 1 message Jul 2, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw
Quoted 14 lines · Jesse Millan

{

(quoted diff) +2 -1
 	struct sk_buff *skb;
+	int err = 0;
 
 	while (1) {
 		skb = skb_dequeue(&audit_skb_queue);
 		if (skb) {
 			if (audit_pid) {
-				int err = netlink_unicast(audit_sock, skb, audit_pid, 0);
+				err = netlink_unicast(audit_sock, skb, audit_pid, 0);
 				if (err < 0) {
 					BUG_ON(err != -ECONNREFUSED); /* Shoudn't happen */
 					printk(KERN_ERR "audit: *NO* daemon at audit_pid=%d\n", audit_pid);

Review int kauditd_thread(void *dummy) · line 310

Quoted 5 lines
(quoted diff) +1 -0
@@ -305,6 +306,7 @@ int kauditd_thread(void *dummy)
 			remove_wait_queue(&kauditd_wait, &wait);
 		}
 	}
+	return err;
 }

Doesn't this warn about unreachable code? ;-)

Randy's suggestion seems right.

Domen

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors