Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354028
b: refs/heads/master
c: 43f9137
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 58b4994 commit edb85d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d21af4cbfb7fccbccedc1d9e143a14aee6b1c9ad
refs/heads/master: 43f9137df461f6365f76b46f404fd6775eab7d51
11 changes: 7 additions & 4 deletions trunk/drivers/staging/comedi/comedi_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,17 @@ unsigned int comedi_buf_read_n_available(struct comedi_async *async)
{
unsigned num_bytes;

if (async == NULL)
if (!async)
return 0;

num_bytes = async->munge_count - async->buf_read_count;
/* barrier insures the read of munge_count in this
query occurs before any following reads of the buffer which
might be based on the return value from this query.

/*
* ensure the async buffer 'counts' are read before we
* attempt to read data from the buffer
*/
smp_rmb();

return num_bytes;
}
EXPORT_SYMBOL(comedi_buf_read_n_available);
Expand Down

0 comments on commit edb85d5

Please sign in to comment.