diff mbox

dm-lc.c: return -ENOMEM if alloc_workqueue fails

Message ID 1375130890-9279-1-git-send-email-gmate.amit@gmail.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Kumar Amit Mehta July 29, 2013, 8:48 p.m. UTC
Audit the return value of alloc_workqueue and return -ENOMEM if it fails

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
---
 Driver/dm-lc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Akira Hayakawa July 30, 2013, 1:14 p.m. UTC | #1
Kumar,

Thanks for your patch, applied.

Akira

On 7/30/13 5:48 AM, Kumar Amit Mehta wrote:
> Audit the return value of alloc_workqueue and return -ENOMEM if it fails
> 
> Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>
> ---
>  Driver/dm-lc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/Driver/dm-lc.c b/Driver/dm-lc.c
> index 4f48cf2..9d394ee 100644
> --- a/Driver/dm-lc.c
> +++ b/Driver/dm-lc.c
> @@ -2963,6 +2963,8 @@ static int __init lc_module_init(void)
>  
>  	safe_io_wq = alloc_workqueue("safeiowq",
>  				     WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
> +	if (!safe_io_wq)
> +		return -ENOMEM;
>  
>  	lc_io_client = dm_io_client_create();
>  
> 

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

diff --git a/Driver/dm-lc.c b/Driver/dm-lc.c
index 4f48cf2..9d394ee 100644
--- a/Driver/dm-lc.c
+++ b/Driver/dm-lc.c
@@ -2963,6 +2963,8 @@  static int __init lc_module_init(void)
 
 	safe_io_wq = alloc_workqueue("safeiowq",
 				     WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
+	if (!safe_io_wq)
+		return -ENOMEM;
 
 	lc_io_client = dm_io_client_create();