Skip to contentSkip to conversation

pcmcia:Fix memory leak in the function, sa11xx_drv_pcmcia_probe

PATCH Russell King - ARM Linux 2 participants 3 messages Mar 26, 2015 3 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 1 line · Nicholas Krause

This fixes the memory found when running coccinelle on the latest

How does this "fix the memory" ? Is the memory faulty?

Quoted 5 lines

kernel tree for if we are unable to successfully allocate memory for the structure pointer,sinfo of type skt_dev_info and need to clean up the memory already allocated to the clk structure pointer, clk by calling clk_get on it and freeing the no longer required mermory for this structure pointer.

This makes no sense. clk_get() itself doesn't allocate any memory. As usual, you act as a mechanical automatom which doesn't understand what you're doing or you just guess. I don't care which it is, you are a danger to the kernel by doing this. As many other experienced kernel developers have told you, please stop.

In any case, I'm NAKing your patch as there's better ways to solve this. That's where experience and research come in.

Nevertheless, thanks for pointing out the oversight, and I notice that there are a few more cases too.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 20 lines · Nicholas Krause
Quoted 17 lines · Russell King - ARM Linux
Quoted 1 line · Nicholas Krause

This fixes the memory found when running coccinelle on the latest

How does this "fix the memory" ? Is the memory faulty?

Quoted 5 lines

kernel tree for if we are unable to successfully allocate memory for the structure pointer,sinfo of type skt_dev_info and need to clean up the memory already allocated to the clk structure pointer, clk by calling clk_get on it and freeing the no longer required mermory for this structure pointer.

This makes no sense. clk_get() itself doesn't allocate any memory. As usual, you act as a mechanical automatom which doesn't understand what you're doing or you just guess. I don't care which it is, you are a danger to the kernel by doing this. As many other experienced kernel developers have told you, please stop.

Quoted 7 lines
Quoted 6 lines

In any case, I'm NAKing your patch as there's better ways to solve this.
That's where experience and research come in.

Nevertheless, thanks for pointing out the oversight, and I notice that there are a few more cases too.

Very well then I guess my patch commit message was wrong.

Again, you fail to understand what you are being told. Please re-read the paragraph which starts "In any case, I'm NAKing your patch".

Your patch is one way to solve it, but there are other solutions too. I've just posted a small patch series which addresses the issue you have raised. You need to perform no further action on this.

Signature · 2 lines
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw
Quoted 1 line · Nicholas Krause

I looked through the clk Api and this seems the simplest way to do it. Can you send me your solution as I am curious how yours is better than mine. Furthermore I have finally come to the conclusion that my research efforts need to improve and will look into improving them. Also it would be great if you can put reported by me on the patches in your series fixing this issue.

http://marc.info/?l=linux-pcmcia&m=142736903012616&w=2 and following patches.

Read and learn,

Larry