Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

V4L/DVB (12178): vpif_display: Fix compile time warnings for mutex locking

mutex_lock_interruptible return value has to be handled properly to indicate
the status to the higher layers of the kernel.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Chaithrika U S and committed by
Mauro Carvalho Chehab
13df4f6a e9f4bb55

+23 -8
+23 -8
drivers/media/video/davinci/vpif_display.c
··· 636 636 struct channel_obj *ch = fh->channel; 637 637 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 638 638 639 - mutex_lock_interruptible(&common->lock); 639 + if (mutex_lock_interruptible(&common->lock)) 640 + return -ERESTARTSYS; 641 + 640 642 /* if this instance is doing IO */ 641 643 if (fh->io_allowed[VPIF_VIDEO_INDEX]) { 642 644 /* Reset io_usrs member of channel object */ ··· 722 720 return -EINVAL; 723 721 724 722 /* Fill in the information about format */ 725 - mutex_lock_interruptible(&common->lock); 723 + if (mutex_lock_interruptible(&common->lock)) 724 + return -ERESTARTSYS; 725 + 726 726 if (vpif_get_std_info(ch)) { 727 727 vpif_err("Error getting the standard info\n"); 728 728 return -EINVAL; ··· 772 768 /* store the pix format in the channel object */ 773 769 common->fmt.fmt.pix = *pixfmt; 774 770 /* store the format in the channel object */ 775 - mutex_lock_interruptible(&common->lock); 771 + if (mutex_lock_interruptible(&common->lock)) 772 + return -ERESTARTSYS; 773 + 776 774 common->fmt = *fmt; 777 775 mutex_unlock(&common->lock); 778 776 ··· 825 819 index = VPIF_VIDEO_INDEX; 826 820 827 821 common = &ch->common[index]; 828 - mutex_lock_interruptible(&common->lock); 822 + if (mutex_lock_interruptible(&common->lock)) 823 + return -ERESTARTSYS; 824 + 829 825 if (common->fmt.type != reqbuf->type) { 830 826 ret = -EINVAL; 831 827 goto reqbuf_exit; ··· 987 979 } 988 980 989 981 /* Call encoder subdevice function to set the standard */ 990 - mutex_lock_interruptible(&common->lock); 982 + if (mutex_lock_interruptible(&common->lock)) 983 + return -ERESTARTSYS; 991 984 992 985 ch->video.stdid = *std_id; 993 986 /* Get the information about the standard */ ··· 1094 1085 return ret; 1095 1086 } 1096 1087 1097 - mutex_lock_interruptible(&common->lock); 1088 + if (mutex_lock_interruptible(&common->lock)) 1089 + return -ERESTARTSYS; 1090 + 1098 1091 /* If buffer queue is empty, return error */ 1099 1092 if (list_empty(&common->dma_queue)) { 1100 1093 vpif_err("buffer queue is empty\n"); ··· 1196 1185 return -EINVAL; 1197 1186 } 1198 1187 1199 - mutex_lock_interruptible(&common->lock); 1188 + if (mutex_lock_interruptible(&common->lock)) 1189 + return -ERESTARTSYS; 1190 + 1200 1191 if (buftype == V4L2_BUF_TYPE_VIDEO_OUTPUT) { 1201 1192 /* disable channel */ 1202 1193 if (VPIF_CHANNEL2_VIDEO == ch->channel_id) { ··· 1261 1248 struct common_obj *common = &ch->common[VPIF_VIDEO_INDEX]; 1262 1249 int ret = 0; 1263 1250 1264 - mutex_lock_interruptible(&common->lock); 1251 + if (mutex_lock_interruptible(&common->lock)) 1252 + return -ERESTARTSYS; 1253 + 1265 1254 if (common->started) { 1266 1255 vpif_err("Streaming in progress\n"); 1267 1256 ret = -EBUSY;