Skip to contentSkip to conversation

sound/isa/ad1816a/ad1816a.c: check kmalloc()

PATCH RESEND In review Amit Choudhary 5 participants 7 messages Oct 3, 2006 – Oct 4, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 sound/isa/ad1816a/ad1816a.c: check kmalloc()

Description: Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file sound/isa/ad1816a/ad1816a.c.

sound/isa/ad1816a/ad1816a.c +2 -0
index b33a5fb..fab77ae 100644
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pn
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
+       if(!cfg)
+               return -ENOMEM;
        acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->dev = NULL) {
                kfree(cfg);

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

#1 lore raw

Re: [KJ] [PATCH] [RESEND] sound/isa/ad1816a/ad1816a.c: check

Quoted 1 line · Amit Choudhary

Description: Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file sound/isa/ad1816a/ad1816a.c.

It seems that your mailer converts the tabs to white spaces, that's why your patch cannot be applied.
Regards,
Frederik

Quoted 19 lines
sound/isa/ad1816a/ad1816a.c +2 -0
index b33a5fb..fab77ae 100644
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pn
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
+       if(!cfg)
+               return -ENOMEM;
        acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->dev = NULL) {
                kfree(cfg);
Quoted 5 lines

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

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

#2 lore raw

Re: [KJ] [PATCH] [RESEND] sound/isa/ad1816a/ad1816a.c: check

In reply to Amit Choudhary

Yes, although it can be applied using the -l option of patch. But I will try to fix this.

Quoted 26 lines · --- Frederik Deweerdt
Quoted 1 line · Amit Choudhary

Description: Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file

sound/isa/ad1816a/ad1816a.c.
It seems that your mailer converts the tabs to white spaces, that's why your patch cannot be applied.
Regards,
Frederik

Quoted 19 lines
sound/isa/ad1816a/ad1816a.c +2 -0
index b33a5fb..fab77ae 100644
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pn
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
+       if(!cfg)
+               return -ENOMEM;
        acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->dev = NULL) {
                kfree(cfg);
Quoted 6 lines
Quoted 5 lines

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

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Kernel-janitors mailing list [email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw

Re: [KJ] [PATCH] [RESEND] sound/isa/ad1816a/ad1816a.c: check

In reply to Amit Choudhary
Quoted 6 lines · On Tue, 3 Oct 2006 08:10:22 +0000 Frederik Deweerdt wrote:
Quoted 1 line · Amit Choudhary

Description: Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file sound/isa/ad1816a/ad1816a.c.

It seems that your mailer converts the tabs to white spaces, that's why your patch cannot be applied.
Regards,
Frederik

Please use a space after "if"....
(and after for, while, switch; but not after function names :)

Quoted 10 lines
Quoted 10 lines
sound/isa/ad1816a/ad1816a.c +0 -0
index b33a5fb..fab77ae 100644
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pn
        struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
        int err;
 
Quoted 5 lines

sound/isa/ad1816a/ad1816a.c static int __devinit snd_card_ad1816a_pn · line 127

Quoted 5 lines
sound/isa/ad1816a/ad1816a.c +2 -0
+       if(!cfg)
+               return -ENOMEM;
        acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
        if (acard->dev = NULL) {
                kfree(cfg);

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

#4 lore raw

PATCH RESEND 1/1 sound/isa/ad1816a/ad1816a.c: check kmalloc()

In reply to Amit Choudhary

Description: Check the return value of kmalloc() in function snd_card_ad1816a_pnp(), in file sound/isa/ad1816a/ad1816a.c.

sound/isa/ad1816a/ad1816a.c +2 -0
index b33a5fb..16daaed 100644
@@ -120,6 +120,8 @@ static int __devinit snd_card_ad1816a_pn
 	struct pnp_resource_table *cfg = kmalloc(sizeof(*cfg), GFP_KERNEL);
 	int err;
 
+	if(!cfg)
+		return -ENOMEM;
 	acard->dev = pnp_request_card_device(card, id->devs[0].id, NULL);
 	if (acard->dev = NULL) {
 		kfree(cfg);

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

#5 lore raw

Re: [KJ] [PATCH] [RESEND] sound/isa/ad1816a/ad1816a.c: check

In reply to Amit Choudhary

sound/isa/ad1816a/ad1816a.c static int __devinit snd_card_ad1816a_pn · line 124

Quoted 2 lines · Amit Choudhary
sound/isa/ad1816a/ad1816a.c +2 -0
+       if(!cfg)
+               return -ENOMEM;

There is still a space missing between if and (.

Wrong:+ if(!cfg)
Correct:+ if (!cfg)

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

#6 lore raw

Re: [KJ] [PATCH] [RESEND] sound/isa/ad1816a/ad1816a.c: check

In reply to Amit Choudhary
Quoted 6 lines · Dan Carpenter

sound/isa/ad1816a/ad1816a.c static int __devinit snd_card_ad1816a_pn · line 124

Quoted 2 lines · Amit Choudhary
sound/isa/ad1816a/ad1816a.c +2 -0
+       if(!cfg)
+               return -ENOMEM;

There is still a space missing between if and (.

thanks for pointing it out. my mistake. I will send again. sent the old one by mistake. but atleast got the email client right (sylpheed) that preserves tab spaces. thanks to randy.

Quoted 7 lines

Wrong:+ if(!cfg)
Correct:+ if (!cfg)

regards,
dan carpenter

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