From: Adrian Bunk The Coverity checker found that if req was NULL because find_request returned NULL, this resulted in a break from the switch, but req was later dereferenced (look at the last line of this patch). Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton --- 25-akpm/fs/smbfs/request.c | 3 +++ 1 files changed, 3 insertions(+) diff -puN fs/smbfs/request.c~fs-smbfs-requestc-fix-null-dereference fs/smbfs/request.c --- 25/fs/smbfs/request.c~fs-smbfs-requestc-fix-null-dereference 2005-03-24 18:24:00.000000000 -0800 +++ 25-akpm/fs/smbfs/request.c 2005-03-24 18:24:00.000000000 -0800 @@ -790,6 +790,9 @@ int smb_request_recv(struct smb_sb_info break; } + if (!req) + return -ENOMEM; + if (result < 0) { /* We saw an error */ return result; _