]> git.baikalelectronics.ru Git - kernel.git/commit
hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.
authorMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Thu, 21 Jan 2010 12:55:16 +0000 (18:25 +0530)
committerFrederic Weisbecker <fweisbec@gmail.com>
Thu, 28 Jan 2010 13:15:51 +0000 (14:15 +0100)
commit4a86af54584fd056cad1f46288f8cec0cca67148
treee170892469ddbcb2ee249271e52264f961c58476
parent04ecf479f3d0caa85ef56f4f41c3b0785852714f
hw_breakpoints: Release the bp slot if arch_validate_hwbkpt_settings() fails.

On a given architecture, when hardware breakpoint registration fails
due to un-supported access type (read/write/execute), we lose the bp
slot since register_perf_hw_breakpoint() does not release the bp slot
on failure.
Hence, any subsequent hardware breakpoint registration starts failing
with 'no space left on device' error.

This patch introduces error handling in register_perf_hw_breakpoint()
function and releases bp slot on error.

Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: K. Prasad <prasad@linux.vnet.ibm.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
LKML-Reference: <20100121125516.GA32521@in.ibm.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
kernel/hw_breakpoint.c