2004-06-06 16:21:28

by Yury Umanets

[permalink] [raw]
Subject: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

Adds memory allocation checks in acpi_get__hpp()

./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2 ++
1 files changed, 2 insertions(+)

Signed-off-by: Yury Umanets <[email protected]>

diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
--- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
05:32:28 2004
+++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Wed Jun
2 14:28:07 2004
@@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
}

ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
+ if (!ab->_hpp)
+ goto free_and_return;
memset(ab->_hpp, 0, sizeof(struct acpi__hpp));

ab->_hpp->cache_line_size = nui[0];

--
umka


2004-06-06 17:56:53

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

On Sun, 06 Jun 2004 19:20:51 +0300 Yury Umanets wrote:

| Adds memory allocation checks in acpi_get__hpp()
|
| ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2 ++
| 1 files changed, 2 insertions(+)
|
| Signed-off-by: Yury Umanets <[email protected]>
|
| diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
| ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
| --- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
| 05:32:28 2004
| +++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Wed Jun
| 2 14:28:07 2004
| @@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
| }
|
| ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
| + if (!ab->_hpp)
| + goto free_and_return;
| memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
|
| ab->_hpp->cache_line_size = nui[0];
|
| --

All other failure paths in this function use err() to inform the
console about what's happening... so flip a coin, I guess:
add a message or say that ACPI already has too many messages. :(

--
~Randy

2004-06-07 15:52:47

by Yury Umanets

[permalink] [raw]
Subject: Re: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

On Sun, 2004-06-06 at 20:51, Randy.Dunlap wrote:
> On Sun, 06 Jun 2004 19:20:51 +0300 Yury Umanets wrote:
>
> | Adds memory allocation checks in acpi_get__hpp()
> |
> | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2 ++
> | 1 files changed, 2 insertions(+)
> |
> | Signed-off-by: Yury Umanets <[email protected]>
> |
> | diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
> | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
> | --- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
> | 05:32:28 2004
> | +++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Wed Jun
> | 2 14:28:07 2004
> | @@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
> | }
> |
> | ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
> | + if (!ab->_hpp)
> | + goto free_and_return;
> | memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
> |
> | ab->_hpp->cache_line_size = nui[0];
> |
> | --
>
> All other failure paths in this function use err() to inform the
> console about what's happening... so flip a coin, I guess:
> add a message or say that ACPI already has too many messages. :(

Hello Randy!

Fixed versions for both (shpchprm_acpi.c and pciehprm_acpi.c) are below:

./linux-2.6.6-modified/drivers/pci/hotplug/pciehprm_acpi.c | 4 ++++
1 files changed, 4 insertions(+)

Signed-off-by: Yury Umanets <[email protected]>

diff -rupN ./linux-2.6.6/drivers/pci/hotplug/pciehprm_acpi.c
./linux-2.6.6-modified/drivers/pci/hotplug/pciehprm_acpi.c
--- ./linux-2.6.6/drivers/pci/hotplug/pciehprm_acpi.c Mon May 10
05:33:19 2004
+++ ./linux-2.6.6-modified/drivers/pci/hotplug/pciehprm_acpi.c Mon Jun
7 18:40:15 2004
@@ -218,6 +218,10 @@ static void acpi_get__hpp ( struct acpi_
}

ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
+ if (!ab->_hpp) {
+ err ("acpi_pciehprm:%s alloc for _HPP fail\n", path_name);
+ goto free_and_return;
+ }
memset(ab->_hpp, 0, sizeof(struct acpi__hpp));

ab->_hpp->cache_line_size = nui[0];


./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 4 ++++
1 files changed, 4 insertions(+)

diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
--- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
05:32:28 2004
+++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Mon Jun
7 18:39:01 2004
@@ -218,6 +218,10 @@ static void acpi_get__hpp ( struct acpi_
}

ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
+ if (!ab->_hpp) {
+ err ("acpi_shpchprm:%s alloc for _HPP fail\n", path_name);
+ goto free_and_return;
+ }
memset(ab->_hpp, 0, sizeof(struct acpi__hpp));

ab->_hpp->cache_line_size = nui[0];


--
umka

Subject: Re: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c


Hello Randy, Yury,

Em Sun, Jun 06, 2004 at 10:51:06AM -0700, Randy.Dunlap escreveu:

| On Sun, 06 Jun 2004 19:20:51 +0300 Yury Umanets wrote:
|
| | Adds memory allocation checks in acpi_get__hpp()
| |
| | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2 ++
| | 1 files changed, 2 insertions(+)
| |
| | Signed-off-by: Yury Umanets <[email protected]>
| |
| | diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
| | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
| | --- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
| | 05:32:28 2004
| | +++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Wed Jun
| | 2 14:28:07 2004
| | @@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
| | }
| |
| | ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
| | + if (!ab->_hpp)
| | + goto free_and_return;
| | memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
| |
| | ab->_hpp->cache_line_size = nui[0];
| |
| | --
|
| All other failure paths in this function use err() to inform the
| console about what's happening... so flip a coin, I guess:
| add a message or say that ACPI already has too many messages. :(

I sent the same patch for this some weeks ago. Dely accepted, but it was
not applyed. Don't know why.


--
Luiz Fernando N. Capitulino
<http://www.telecentros.sp.gov.br>

2004-06-07 17:59:05

by Sy, Dely L

[permalink] [raw]
Subject: RE: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

Hi, Luiz,

I sent out the patch to Greg last week and he'll apply it.

Thanks,
Dely

-----Original Message-----
From: Luiz Fernando N. Capitulino
[mailto:[email protected]]
Sent: Monday, June 07, 2004 10:36 AM
To: Randy.Dunlap
Cc: Yury Umanets; [email protected]; [email protected]; Sy, Dely
L
Subject: Re: [PATCH] 2.6.6 memory allocation checks in
drivers/pci/hotplug/shpchprm_acpi.c


Hello Randy, Yury,

Em Sun, Jun 06, 2004 at 10:51:06AM -0700, Randy.Dunlap escreveu:

| On Sun, 06 Jun 2004 19:20:51 +0300 Yury Umanets wrote:
|
| | Adds memory allocation checks in acpi_get__hpp()
| |
| | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2
++
| | 1 files changed, 2 insertions(+)
| |
| | Signed-off-by: Yury Umanets <[email protected]>
| |
| | diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
| | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
| | --- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May
10
| | 05:32:28 2004
| | +++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
Wed Jun
| | 2 14:28:07 2004
| | @@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
| | }
| |
| | ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
| | + if (!ab->_hpp)
| | + goto free_and_return;
| | memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
| |
| | ab->_hpp->cache_line_size = nui[0];
| |
| | --
|
| All other failure paths in this function use err() to inform the
| console about what's happening... so flip a coin, I guess:
| add a message or say that ACPI already has too many messages. :(

I sent the same patch for this some weeks ago. Dely accepted, but it
was
not applyed. Don't know why.


--
Luiz Fernando N. Capitulino
<http://www.telecentros.sp.gov.br>

2004-06-07 18:17:03

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

On Mon, Jun 07, 2004 at 10:56:54AM -0700, Sy, Dely L wrote:
> Hi, Luiz,
>
> I sent out the patch to Greg last week and he'll apply it.

Dely, was this in the patch that I applied on Friday?

thanks,

greg k-h

2004-06-07 18:28:22

by Sy, Dely L

[permalink] [raw]
Subject: RE: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

On Monday, June 07, 2004 11:12 AM, Greg KH wrote:
> On Mon, Jun 07, 2004 at 10:56:54AM -0700, Sy, Dely L wrote:
> > Hi, Luiz,
> >
> > I sent out the patch to Greg last week and he'll apply it.
>
> Dely, was this in the patch that I applied on Friday?

Yes.

Thanks,
Dely


2004-06-08 06:14:33

by Yury Umanets

[permalink] [raw]
Subject: Re: [PATCH] 2.6.6 memory allocation checks in drivers/pci/hotplug/shpchprm_acpi.c

On Mon, 2004-06-07 at 20:35, Luiz Fernando N. Capitulino wrote:
> Hello Randy, Yury,
>
> Em Sun, Jun 06, 2004 at 10:51:06AM -0700, Randy.Dunlap escreveu:
>
> | On Sun, 06 Jun 2004 19:20:51 +0300 Yury Umanets wrote:
> |
> | | Adds memory allocation checks in acpi_get__hpp()
> | |
> | | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c | 2 ++
> | | 1 files changed, 2 insertions(+)
> | |
> | | Signed-off-by: Yury Umanets <[email protected]>
> | |
> | | diff -rupN ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c
> | | ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c
> | | --- ./linux-2.6.6/drivers/pci/hotplug/shpchprm_acpi.c Mon May 10
> | | 05:32:28 2004
> | | +++ ./linux-2.6.6-modified/drivers/pci/hotplug/shpchprm_acpi.c Wed Jun
> | | 2 14:28:07 2004
> | | @@ -218,6 +218,8 @@ static void acpi_get__hpp ( struct acpi_
> | | }
> | |
> | | ab->_hpp = kmalloc (sizeof (struct acpi__hpp), GFP_KERNEL);
> | | + if (!ab->_hpp)
> | | + goto free_and_return;
> | | memset(ab->_hpp, 0, sizeof(struct acpi__hpp));
> | |
> | | ab->_hpp->cache_line_size = nui[0];
> | |
> | | --
> |
> | All other failure paths in this function use err() to inform the
> | console about what's happening... so flip a coin, I guess:
> | add a message or say that ACPI already has too many messages. :(
>
> I sent the same patch for this some weeks ago. Dely accepted, but it was
> not applyed. Don't know why.
Hello,

I'm not sure that I know the order of patches reviewing/applying, but it
seems to be depend on contact person busyness and importance of the
patch. This patch is not so important though :)

--
umka