diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 770c4324f3d5750e51eae824fd59a985209b9732..b1056d290ae27b25b807fa125a78340540b58163 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4509,6 +4509,7 @@ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pa
 	if (res > 0) {
 		for (j=0; j < res; j++)
 			page_cache_release(pages[j]);
+		res = 0;
 	}
 	kfree(pages);
 	return res;