User: | Jiri Slaby |
Error type: | Invalid Pointer Dereference |
Error type description: | A pointer which is invalid is being dereferenced |
File location: | fs/dcache.c |
Line in file: | 1271 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Smatch
(1.59)
|
Entered: | 2013-09-10 20:24:52 UTC |
1241 * For a case-insensitive lookup match and if the the case-exact dentry 1242 * already exists in in the dcache, use it and return it. 1243 * 1244 * If no entry exists with the exact case name, allocate new dentry with 1245 * the exact case, and return the spliced entry. 1246 */ 1247struct dentry *d_add_ci(struct dentry *dentry, struct inode *inode, 1248 struct qstr *name) 1249{ 1250 int error; 1251 struct dentry *found; 1252 struct dentry *new; 1253 1254 /* Does a dentry matching the name exist already? */ 1255 found = d_hash_and_lookup(dentry->d_parent, name); 1256 /* If not, create it now and return */ 1257 if (!found) { 1258 new = d_alloc(dentry->d_parent, name); 1259 if (!new) { 1260 error = -ENOMEM; 1261 goto err_out; 1262 } 1263 found = d_splice_alias(inode, new); 1264 if (found) { 1265 dput(new); 1266 return found; 1267 } 1268 return new; 1269 } 1270 /* Matching dentry exists, check if it is negative. */ 1271 if (found->d_inode) { 1272 if (unlikely(found->d_inode != inode)) { 1273 /* This can't happen because bad inodes are unhashed. */ 1274 BUG_ON(!is_bad_inode(inode)); 1275 BUG_ON(!is_bad_inode(found->d_inode)); 1276 } 1277 /* 1278 * Already have the inode and the dentry attached, decrement 1279 * the reference count to balance the iget() done 1280 * earlier on. We found the dentry using d_lookup() so it 1281 * cannot be disconnected and thus we do not need to worry