aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2009-11-12 17:08:36 -0500
committerJiri Kosina <jkosina@suse.cz>2010-02-04 05:55:46 -0500
commit7e2a10836c0455cb3ca397f89b8280496148d571 (patch)
tree26a00a1581727fb1177e509826bedd727b53a265 /fs
parentfe9a2302230fa287715a11a3d3aec74eec75a6a4 (diff)
fs/qnx4: decrement sizeof size in strncmp
As an identical match is wanted in this case, strcmp can be used instead. The semantic match that lead to detecting this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression foo; constant char *abc; @@ *strncmp(foo, abc, sizeof(abc)) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Anders Larsen <al@alarsen.net> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/qnx4/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/qnx4/inode.c b/fs/qnx4/inode.c
index ebf3440d28ca..277575ddc05c 100644
--- a/fs/qnx4/inode.c
+++ b/fs/qnx4/inode.c
@@ -201,7 +201,8 @@ static const char *qnx4_checkroot(struct super_block *sb)
201 rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE); 201 rootdir = (struct qnx4_inode_entry *) (bh->b_data + i * QNX4_DIR_ENTRY_SIZE);
202 if (rootdir->di_fname != NULL) { 202 if (rootdir->di_fname != NULL) {
203 QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname)); 203 QNX4DEBUG((KERN_INFO "rootdir entry found : [%s]\n", rootdir->di_fname));
204 if (!strncmp(rootdir->di_fname, QNX4_BMNAME, sizeof QNX4_BMNAME)) { 204 if (!strcmp(rootdir->di_fname,
205 QNX4_BMNAME)) {
205 found = 1; 206 found = 1;
206 qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL ); 207 qnx4_sb(sb)->BitMap = kmalloc( sizeof( struct qnx4_inode_entry ), GFP_KERNEL );
207 if (!qnx4_sb(sb)->BitMap) { 208 if (!qnx4_sb(sb)->BitMap) {