All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] md/dm-log: use PTR_ERR value instead of -ENOMEM
@ 2010-05-16  6:31 Dan Carpenter
  2011-01-07 20:08 ` Jonathan Brassow
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-05-16  6:31 UTC (permalink / raw)
  To: Neil Brown
  Cc: Alasdair G Kergon, Mikulas Patocka, Nikanth Karthikesan,
	Mike Snitzer, Martin K. Petersen, dm-devel, linux-raid

It's nicer to return the PTR_ERR() value instead of just returning
-ENOMEM.  In the current code the PTR_ERR() value is always equal to
-ENOMEM so this doesn't actually affect anything, but still...

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
index 5a08be0..fbd80fb 100644
--- a/drivers/md/dm-log.c
+++ b/drivers/md/dm-log.c
@@ -455,7 +455,7 @@ static int create_log_context(struct dm_dirty_log *log, struct dm_target *ti,
 			r = PTR_ERR(lc->io_req.client);
 			DMWARN("couldn't allocate disk io client");
 			kfree(lc);
-			return -ENOMEM;
+			return r;
 		}
 
 		lc->disk_header = vmalloc(buf_size);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] md/dm-log: use PTR_ERR value instead of -ENOMEM
  2010-05-16  6:31 [patch] md/dm-log: use PTR_ERR value instead of -ENOMEM Dan Carpenter
@ 2011-01-07 20:08 ` Jonathan Brassow
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Brassow @ 2011-01-07 20:08 UTC (permalink / raw)
  To: device-mapper development

ACK

  brassow

On May 16, 2010, at 1:31 AM, Dan Carpenter wrote:

> It's nicer to return the PTR_ERR() value instead of just returning
> -ENOMEM.  In the current code the PTR_ERR() value is always equal to
> -ENOMEM so this doesn't actually affect anything, but still...
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/drivers/md/dm-log.c b/drivers/md/dm-log.c
> index 5a08be0..fbd80fb 100644
> --- a/drivers/md/dm-log.c
> +++ b/drivers/md/dm-log.c
> @@ -455,7 +455,7 @@ static int create_log_context(struct  
> dm_dirty_log *log, struct dm_target *ti,
> 			r = PTR_ERR(lc->io_req.client);
> 			DMWARN("couldn't allocate disk io client");
> 			kfree(lc);
> -			return -ENOMEM;
> +			return r;
> 		}
>
> 		lc->disk_header = vmalloc(buf_size);
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-01-07 20:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-16  6:31 [patch] md/dm-log: use PTR_ERR value instead of -ENOMEM Dan Carpenter
2011-01-07 20:08 ` Jonathan Brassow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.