Description
I am playing with new version of smatch and it highlighted this interesting piece in ll_page_mkwrite0:
if (result == 0) {
struct inode *inode = vma->vm_file->f_dentry->d_inode;
struct ll_inode_info *lli = ll_i2info(inode);
lock_page(vmpage);
if (vmpage->mapping == NULL) {
unlock_page(vmpage);
/* page was truncated and lock was cancelled, return
* ENODATA so that VM_FAULT_NOPAGE will be returned
* to handle_mm_fault(). */
if (result == 0)
result = -ENODATA;
So we are on a path that already checked result to be 0 and then we check again? Is there a missing call to somewhere?