public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* possible NULL pointer usage
@ 2007-04-07  9:21 Cyrill Gorcunov
  0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2007-04-07  9:21 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, Ben Fennema

Hi,

from the function fs/udf/inode.c:udf_fill_inode -

	...

	UDF_I_DATA(inode) = kmalloc(inode->i_sb->s_blocksize - sizeof(struct extendedFileEntry), GFP_KERNEL);
	memcpy(UDF_I_DATA(inode), bh->b_data + sizeof(struct extendedFileEntry), inode->i_sb->s_blocksize - sizeof(struct extendedFileEntry));

	...

so that can lead to NULL pointer usage. udf_fill_inode()
declared as 'void' and the question I have is: what is the
best solution to deal with a situation if kmalloc failed?
May be just mark the node as bad by calling make_bad_inode()
and return from the function?


		Cyrill


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-07  9:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-07  9:21 possible NULL pointer usage Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox