* fs/ntfs/super.c:2717:1-14: alloc with no test
@ 2012-08-26 9:04 Fengguang Wu
2012-08-26 9:12 ` devendra.aaru
0 siblings, 1 reply; 3+ messages in thread
From: Fengguang Wu @ 2012-08-26 9:04 UTC (permalink / raw)
To: Anton Altaparmakov; +Cc: kernel-janitors, linux-ntfs-dev, linux-kernel
Hi Anton,
FYI, coccinelle warns about
fs/ntfs/super.c:2717:1-14: alloc with no test, possible model on line 2718
vim +2717 fs/ntfs/super.c
2714 sb->s_flags |= MS_RDONLY;
2715 #endif /* ! NTFS_RW */
2716 /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */
> 2717 sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS);
2718 vol = NTFS_SB(sb);
2719 if (!vol) {
2720 if (!silent)
---
0-DAY kernel build testing backend Open Source Technology Centre
Fengguang Wu <wfg@linux.intel.com> Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: fs/ntfs/super.c:2717:1-14: alloc with no test
2012-08-26 9:04 fs/ntfs/super.c:2717:1-14: alloc with no test Fengguang Wu
@ 2012-08-26 9:12 ` devendra.aaru
2012-08-26 9:31 ` Fengguang Wu
0 siblings, 1 reply; 3+ messages in thread
From: devendra.aaru @ 2012-08-26 9:12 UTC (permalink / raw)
To: Fengguang Wu
Cc: Anton Altaparmakov, kernel-janitors, linux-ntfs-dev, linux-kernel
On Sun, Aug 26, 2012 at 2:34 PM, Fengguang Wu <fengguang.wu@intel.com> wrote:
>
> Hi Anton,
>
> FYI, coccinelle warns about
>
> fs/ntfs/super.c:2717:1-14: alloc with no test, possible model on line 2718
>
> vim +2717 fs/ntfs/super.c
> 2714 sb->s_flags |= MS_RDONLY;
> 2715 #endif /* ! NTFS_RW */
> 2716 /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */
>> 2717 sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS);
That's i think a false alarm.
> 2718 vol = NTFS_SB(sb);
The NTFS_SB(buf) {
buf->s_fs_info;
}
so we are validating the allocated pointer s_fs_info.
correct me if i am wrong.
Thanks,
> 2719 if (!vol) {
> 2720 if (!silent)
>
> ---
> 0-DAY kernel build testing backend Open Source Technology Centre
> Fengguang Wu <wfg@linux.intel.com> Intel Corporation
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: fs/ntfs/super.c:2717:1-14: alloc with no test
2012-08-26 9:12 ` devendra.aaru
@ 2012-08-26 9:31 ` Fengguang Wu
0 siblings, 0 replies; 3+ messages in thread
From: Fengguang Wu @ 2012-08-26 9:31 UTC (permalink / raw)
To: devendra.aaru
Cc: Anton Altaparmakov, kernel-janitors, linux-ntfs-dev, linux-kernel
On Sun, Aug 26, 2012 at 02:42:12PM +0530, devendra.aaru wrote:
> On Sun, Aug 26, 2012 at 2:34 PM, Fengguang Wu <fengguang.wu@intel.com> wrote:
> >
> > Hi Anton,
> >
> > FYI, coccinelle warns about
> >
> > fs/ntfs/super.c:2717:1-14: alloc with no test, possible model on line 2718
> >
> > vim +2717 fs/ntfs/super.c
> > 2714 sb->s_flags |= MS_RDONLY;
> > 2715 #endif /* ! NTFS_RW */
> > 2716 /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */
> >> 2717 sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS);
>
> That's i think a false alarm.
>
> > 2718 vol = NTFS_SB(sb);
>
> The NTFS_SB(buf) {
> buf->s_fs_info;
> }
>
> so we are validating the allocated pointer s_fs_info.
Yes, it is. Sorry for the noise!
Thanks,
Fengguang
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-26 9:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-26 9:04 fs/ntfs/super.c:2717:1-14: alloc with no test Fengguang Wu
2012-08-26 9:12 ` devendra.aaru
2012-08-26 9:31 ` Fengguang Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).