Commit Graph

362065 Commits

Author SHA1 Message Date
David Howells
1f817b86d5 comedi: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: David Schleef <ds@schleef.org>
cc: Ian Abbott <abbotti@mev.co.uk>
cc: Mori Hess <fmhess@users.sourceforge.net>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: H Hartley Sweeten <hsweeten@visionengravers.com>
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:51 -04:00
David Howells
207e39099a ft1000: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marek Belisko <marek.belisko@gmail.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Ondrej Zary <linux@rainbow-software.org>
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:51 -04:00
David Howells
5ba02e355d rtl8187se: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.  Whilst we're at it, reduce the
number of show functions where we can share them.

Question: Do any of the registers read by proc_get_registers() have side
effects upon reading?  If so, locking will be required.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Maxim Mikityanskiy <maxtram95@gmail.com>
cc: YAMANE Toshiaki <yamanetoshi@gmail.com>
cc: Bill Pemberton <wfp5p@virginia.edu>
cc: Andrea Merello <andreamrl@tiscali.it>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:51 -04:00
David Howells
0541f9d08a rtl8192u: Don't use create_proc_read_entry()
Don't use create_proc_read_entry() as that is deprecated, but rather use
proc_create_data() and seq_file instead.  Whilst we're at it, reduce the
number of show functions where we can share them.

Note: proc_get_stats_ap() should probably use seq_file iteration rather than
list_for_each_entry().

Further note: There appears to be a lot of locking missing in this file to
defend against concurrent access by the driver doing normal operations.
Notably, ieee->network_list traversal and RWCAM/RCAMO command/response access.
Further, do any of the registers read have side effects upon reading?

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: Mauro Carvalho Chehab <mchehab@redhat.com>
cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:50 -04:00
David Howells
d0206fb555 procfs: Mark create_proc_read_entry deprecated
Mark create_proc_read_entry deprecated.  proc_create[_data]() should be used
instead.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:50 -04:00
Al Viro
14b872f02e xt_hashlimit: allocate a copy of name explicitly, don't rely on procfs guts
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:49 -04:00
Al Viro
89b107adce mISDN: grabbing/dropping reference to THIS_MODULE in open/release is racy
... when you have no ->owner set.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:49 -04:00
Al Viro
ebb06be16b mISDN: fix mISDN_read()/mISDN_read() race
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:49 -04:00
Al Viro
1678ec00a6 mISDN: fix misdn_add_timer()/misdn_del_timer() race
do add_timer() *before* unlocking dev->lock, or unpleasant things can
happen if misdn_del_timer() on another CPU finds the sucker, calls
del_timer_sync() (which does nothing, since we hadn't started the
timer yet) and frees it, just as we get around to add_timer()...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:48 -04:00
Al Viro
1b1089561c mISDN: fix races between misdn_del_timer() and timer callback
mark the victim with negative ->id if misdn_del_timer() finds it on
the list, have timer callback *not* move ones so marked to dev->expired

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:48 -04:00
Al Viro
c08c464d6f mISDN: fix the races with timers going off just as they are deleted
timer callback in timerdev.c both accesses struct mISDNtimer it's
called for *and* moves it to dev->expired.  We need del_timer_sync(),
or we risk kfree() freeing it right under dev_expire_timer() *and*
dev->expired getting corrupted.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:47 -04:00
Al Viro
03feee373f dvb_frontend: don't mess with ->f_op in ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:47 -04:00
Al Viro
7caf2184f2 dvb_net: don't mess with ->f_op in ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:47 -04:00
Al Viro
25643165c3 lis3lv02d: don't wank with fasync() on ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:46 -04:00
Al Viro
70ab27ddb7 mpt3sas: don't wank with fasync on ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:46 -04:00
Al Viro
96625a74c7 mpt2sas: don't wank with fasync on ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:45 -04:00
Al Viro
8e0bcc7222 fix a leak in /proc/schedstats
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:45 -04:00
Al Viro
e84cb41eb0 pmcraid: don't wank with fasync in ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:45 -04:00
Al Viro
f0689f0537 mptctl: don't wank with fasync in ->release()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:44 -04:00
Al Viro
858feacd2b lpfc: fix races for miscdevice open vs. rmmod
mind you, I'm not sure WTF would anybody _need_ that miscdevice
at all - no IO is possible for it, opening it only pins the module
down and is seriously racy, at that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:44 -04:00
Al Viro
3dce1891f3 yurex: don't wank with fasync on ->release()...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:43 -04:00
Al Viro
f269cad7f4 fanotify: don't wank with FASYNC on ->release()
... it's done already by __fput()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:43 -04:00
Al Viro
0e2bcaae83 sock_close() couldn't have been called with NULL inode since at least 2.1.early
... if not since 0.99 or so.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:43 -04:00
Al Viro
e53cfda5d2 tomoyo_close_control: don't bother with return value
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:42 -04:00
Al Viro
fca660beb8 dmasound_core: saner arguments for sq_fsync()
it is not (and it has never been) an ->fsync() instance...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:42 -04:00
Al Viro
79d0a3e399 hppfs: get rid of ->fsync()
it has grown by accident - directories there do *not* use page cache, so
there's nothing to write.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:42 -04:00
Al Viro
b5edfd2769 hppfs: fix the leaks on close()
we need to close the underlying procfs file and free ->private_data

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:41:41 -04:00
Al Viro
3dc20cb282 new helper: read_code()
switch binfmts that use ->read() to that (and to kernel_read()
in several cases in binfmt_flat - sure, it's nommu, but still,
doing ->read() into kmalloc'ed buffer...)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-29 15:40:23 -04:00
Al Viro
3af0761307 cx25821: sanitize cx25821_openfile_audio() a bit...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-13 16:48:24 -04:00
Al Viro
2ce8fce2ea cx25821: sanitize cx25821_get_audio_data() a bit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-13 16:35:35 -04:00
Al Viro
05c0ae21c0 try a saner locking for pde_opener...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:52 -04:00
Al Viro
ca469f35a8 deal with races between remove_proc_entry() and proc_reg_release()
* serialize the call of ->release() on per-pdeo mutex
* don't remove pdeo from per-pde list until we are through with it

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:51 -04:00
Al Viro
866ad9a747 procfs: preparations for remove_proc_entry() race fixes
* leave ->proc_fops alone; make ->pde_users negative instead
* trim pde_opener
* move relevant code in fs/proc/inode.c

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:51 -04:00
David Howells
ad147d011f procfs: Clean up huge if-statement in __proc_file_read()
Switch huge if-statement in __proc_file_read() around.  This then puts the
single line loop break immediately after the if-statement and allows us to
de-indent the huge comment and make it take fewer lines.  The code following
the if-statement then follows naturally from the call to dp->read_proc().

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 15:16:50 -04:00
Al Viro
f805442e13 vt6655: slightly clean reading config file
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:50 -04:00
Al Viro
7c51d177f0 vt6656: slightly sanitized reading config
Just reading - parsing the results is left alone (and unspeakably
lousy).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:50 -04:00
Al Viro
434b5a2e2d sound_firmware: don't bother with filp_close()
it's opened read-only and never installed into any descriptor tables;
fput() will do just as well.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 15:16:32 -04:00
Al Viro
264bd6602e pxa3xx-gcu: stop embedding file_operations into device-private object
no need to do that anymore...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:40 -04:00
Al Viro
996142e61d pxa3xx-gcu: quite playing silly buggers with ->f_op
misc device gets ->private_data pointing to struct miscdevice
on open(), so we can use that to get to per-device structure
instead of relying on file_operations being copied into it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:40 -04:00
David Howells
7294b0bb69 silicom-bypass: Remove device_open/close()
Remove device_open/close() functions as they don't really do anything and
remove Device_Open as it isn't counted atomically and the value isn't used.

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 14:16:40 -04:00
David Howells
80e928f7eb proc: Kill create_proc_entry()
Kill create_proc_entry() in favour of create_proc_read_entry(), proc_create()
and proc_create_data().

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 14:16:39 -04:00
David Howells
3cba53765b wlags49_h2: Don't use create_proc_entry()
create_proc_entry() shouldn't be used.  Rather proc_create_data() should be
used.  The proc_write() function is only used by #if'd out code, so delete it
for now.

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 14:16:39 -04:00
David Howells
8a25378e40 nubus: Don't use create_proc_entry()
Don't use create_proc_entry() in nubus_proc_subdir().  The files created aren't
given any way to use them, so for the moment use create_proc_read_entry() with
a NULL accessor and generate a compile-time warning.

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 14:16:38 -04:00
David Howells
4554eb9065 UM: Adjust printk in create_proc_mconsole()
Adjust printk in create_proc_mconsole() to reflect it is now using
proc_create() not create_proc_mconsole().

Signed-off-by: David Howells <dhowells@redhat.com>
2013-04-09 14:16:38 -04:00
Al Viro
75ef9de126 constify a bunch of struct file_operations instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:16:20 -04:00
Al Viro
c10c062cad bluetooth: kill unused fops field in struct bt_sock_list
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:37 -04:00
Al Viro
4d006263d3 bluetooth: fix race in bt_procfs_init()
use proc_create_data() rather than set ->data after the file has
been created

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:36 -04:00
Al Viro
b03166152f bluetooth: kill unused 'module' argument of bt_procfs_init()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:36 -04:00
Al Viro
14805359c7 bluetooth: don't bother with ->owner for procfs fops
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:36 -04:00
Al Viro
345566bd72 x25: use proc_remove_subtree()
... and don't bother with ->owner, while we are at it - procfs fops
do not need it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:35 -04:00