Skip to contentSkip to conversation

PATCH In review Gaurav Singh 3 participants 4 messages Jun 9, 2020

Subsystems (4)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 bpf: alloc_record_per_cpu Add null check after malloc

---
 samples/bpf/xdp_rxq_info_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/xdp_rxq_info_user.c +1 -1
index 4fe47502ebed..490b07b7df78 100644
@@ -202,11 +202,11 @@ static struct datarec *alloc_record_per_cpu(void)
 
 	size = sizeof(struct datarec) * nr_cpus;
 	array = malloc(size);
-	memset(array, 0, size);
 	if (!array) {
 		fprintf(stderr, "Mem alloc error (nr_cpus:%u)\n", nr_cpus);
 		exit(EXIT_FAIL_MEM);
 	}
+	memset(array, 0, size);
 	return array;
 }
 
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH] bpf: alloc_record_per_cpu Add null check after malloc

Quoted 4 lines · Gaurav Singh
---
 samples/bpf/xdp_rxq_info_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I know I don't take patches without any changelog text, maybe other maintainers are more lax...

#3 lore raw

Re: your mail

In reply to Gaurav Singh
Quoted 12 lines · Gaurav Singh

Please find the patch below.

Thanks and regards,
Gaurav.

Quoted 1 line

From Gaurav Singh <[email protected]> # This line is ignored.

From: Gaurav Singh <[email protected]>
Reply-To:
Subject:
In-Reply-To:

I think something went wrong in your submission, just use 'git send-email' to send the patch out.

thanks,

greg k-h