aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7164
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-11-24 00:36:57 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:52:18 -0400
commit061d55eb450102408289599ae79b92322d6126e1 (patch)
treec31b0088a8576de0e6eed098176dc81a7a079432 /drivers/media/video/saa7164
parent050bf0faa833028f30ed3ad6a8fc5e51994dabfe (diff)
[media] saa7164: poll mask set incorrectly
list_first_entry() always returns non-null here. I think the intent was to test whether there were any entries in the used list. Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Steven Toth <stoth@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7164')
-rw-r--r--drivers/media/video/saa7164/saa7164-encoder.c6
-rw-r--r--drivers/media/video/saa7164/saa7164-vbi.c6
2 files changed, 2 insertions, 10 deletions
diff --git a/drivers/media/video/saa7164/saa7164-encoder.c b/drivers/media/video/saa7164/saa7164-encoder.c
index 400364569c8d..2fd38a01887f 100644
--- a/drivers/media/video/saa7164/saa7164-encoder.c
+++ b/drivers/media/video/saa7164/saa7164-encoder.c
@@ -1246,7 +1246,6 @@ static unsigned int fops_poll(struct file *file, poll_table *wait)
1246 struct saa7164_encoder_fh *fh = 1246 struct saa7164_encoder_fh *fh =
1247 (struct saa7164_encoder_fh *)file->private_data; 1247 (struct saa7164_encoder_fh *)file->private_data;
1248 struct saa7164_port *port = fh->port; 1248 struct saa7164_port *port = fh->port;
1249 struct saa7164_user_buffer *ubuf;
1250 unsigned int mask = 0; 1249 unsigned int mask = 0;
1251 1250
1252 port->last_poll_msecs_diff = port->last_poll_msecs; 1251 port->last_poll_msecs_diff = port->last_poll_msecs;
@@ -1278,10 +1277,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait)
1278 } 1277 }
1279 1278
1280 /* Pull the first buffer from the used list */ 1279 /* Pull the first buffer from the used list */
1281 ubuf = list_first_entry(&port->list_buf_used.list, 1280 if (!list_empty(&port->list_buf_used.list))
1282 struct saa7164_user_buffer, list);
1283
1284 if (ubuf)
1285 mask |= POLLIN | POLLRDNORM; 1281 mask |= POLLIN | POLLRDNORM;
1286 1282
1287 return mask; 1283 return mask;
diff --git a/drivers/media/video/saa7164/saa7164-vbi.c b/drivers/media/video/saa7164/saa7164-vbi.c
index bc1fcedba874..e2e034158718 100644
--- a/drivers/media/video/saa7164/saa7164-vbi.c
+++ b/drivers/media/video/saa7164/saa7164-vbi.c
@@ -1192,7 +1192,6 @@ static unsigned int fops_poll(struct file *file, poll_table *wait)
1192{ 1192{
1193 struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data; 1193 struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data;
1194 struct saa7164_port *port = fh->port; 1194 struct saa7164_port *port = fh->port;
1195 struct saa7164_user_buffer *ubuf;
1196 unsigned int mask = 0; 1195 unsigned int mask = 0;
1197 1196
1198 port->last_poll_msecs_diff = port->last_poll_msecs; 1197 port->last_poll_msecs_diff = port->last_poll_msecs;
@@ -1224,10 +1223,7 @@ static unsigned int fops_poll(struct file *file, poll_table *wait)
1224 } 1223 }
1225 1224
1226 /* Pull the first buffer from the used list */ 1225 /* Pull the first buffer from the used list */
1227 ubuf = list_first_entry(&port->list_buf_used.list, 1226 if (!list_empty(&port->list_buf_used.list))
1228 struct saa7164_user_buffer, list);
1229
1230 if (ubuf)
1231 mask |= POLLIN | POLLRDNORM; 1227 mask |= POLLIN | POLLRDNORM;
1232 1228
1233 return mask; 1229 return mask;