drivers: convert sbd_duart.map_guard from atomic_t to refcount_t
authorElena Reshetova <elena.reshetova@intel.com>
Mon, 6 Mar 2017 14:21:15 +0000 (16:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Mar 2017 03:01:40 +0000 (11:01 +0800)
commit22a33651a56fa2a66339db059dcc247aa7131ced
treeb2f88df9ef5133a74ed90a26870ca5c6a96587ef
parent8961df8950b1235cb7594e143a31bcc63757b660
drivers: convert sbd_duart.map_guard from atomic_t to refcount_t

refcount_t type and corresponding API should be
used instead of atomic_t when the variable is used as
a reference counter. This allows to avoid accidental
refcounter overflows that might lead to use-after-free
situations.

Signed-off-by: Elena Reshetova <elena.reshetova@intel.com>
Signed-off-by: Hans Liljestrand <ishkamiel@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/sb1250-duart.c