Powered by Linux
devm_ on lists — Semantic Matching Tool

devm_ on lists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I sometimes have more ideas than I can handle in a day and my mind
resets every night so every morning I am a blank slate like that guy
from that movie.

So I'm going to start writing them down and adding a hashtag.
#StaticCheckerIdeas  I'm going to CC kernel janitors until the Smatch
list gets archived on lore.kernel.org

There is a bug in ti_sci_probe() where it does:

	info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
	...
	list_add_tail(&info->node, &ti_sci_list);
	...
	return of_platform_populate(dev->of_node, NULL, NULL, dev);

Idea 1:  If of_platform_populate() fails, then info freed but it's it's
still on the the &ti_sci_list list.  Look for list_add of devm_ data
and ensure that it's removed from the list before an error code.

There are other lifetime issues surrounding devm_ data.  We need a
list_del in the release function as well.

Idea 2: The other error paths all have clean up so last error path
should have clean up too.

regards,
dan carpenter



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux