All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] scsi/osd: checking NULL instead of ERR_PTR()
@ 2010-11-12  4:31 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2010-11-12  4:31 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, James E.J. Bottomley, osd-dev, linux-scsi, kernel-janitors

bio_map_kern() returns ERR_PTRs on failure and never returns NULL.

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

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 0433ea6..b798919 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
 	/* create a bio for continuation segment */
 	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
 			   GFP_KERNEL);
-	if (unlikely(!bio))
-		return -ENOMEM;
+	if (unlikely(IS_ERR(bio)))
+		return PTR_ERR(bio);
 
 	bio->bi_rw |= REQ_WRITE;
 

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

* [patch] scsi/osd: checking NULL instead of ERR_PTR()
@ 2010-11-12  4:31 ` Dan Carpenter
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Carpenter @ 2010-11-12  4:31 UTC (permalink / raw)
  To: Boaz Harrosh
  Cc: Benny Halevy, James E.J. Bottomley, osd-dev, linux-scsi, kernel-janitors

bio_map_kern() returns ERR_PTRs on failure and never returns NULL.

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

diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
index 0433ea6..b798919 100644
--- a/drivers/scsi/osd/osd_initiator.c
+++ b/drivers/scsi/osd/osd_initiator.c
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
 	/* create a bio for continuation segment */
 	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
 			   GFP_KERNEL);
-	if (unlikely(!bio))
-		return -ENOMEM;
+	if (unlikely(IS_ERR(bio)))
+		return PTR_ERR(bio);
 
 	bio->bi_rw |= REQ_WRITE;
 

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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
  2010-11-12  4:31 ` Dan Carpenter
@ 2010-11-14 13:39   ` Boaz Harrosh
  -1 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-14 13:39 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/12/2010 06:31 AM, Dan Carpenter wrote:
> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

Acked-by: Boaz Harrosh <bharrosh@panasas.com>

> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
> index 0433ea6..b798919 100644
> --- a/drivers/scsi/osd/osd_initiator.c
> +++ b/drivers/scsi/osd/osd_initiator.c
> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>  	/* create a bio for continuation segment */
>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>  			   GFP_KERNEL);
> -	if (unlikely(!bio))
> -		return -ENOMEM;
> +	if (unlikely(IS_ERR(bio)))
> +		return PTR_ERR(bio);
>  
>  	bio->bi_rw |= REQ_WRITE;
>  

Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
for current Kernel.

James: please apply to scsi-rc-fixes for the next round of fixes?

Thanks
Boaz

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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
@ 2010-11-14 13:39   ` Boaz Harrosh
  0 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-14 13:39 UTC (permalink / raw)
  To: Dan Carpenter, James E.J. Bottomley
  Cc: Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/12/2010 06:31 AM, Dan Carpenter wrote:
> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 

Acked-by: Boaz Harrosh <bharrosh@panasas.com>

> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
> index 0433ea6..b798919 100644
> --- a/drivers/scsi/osd/osd_initiator.c
> +++ b/drivers/scsi/osd/osd_initiator.c
> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>  	/* create a bio for continuation segment */
>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>  			   GFP_KERNEL);
> -	if (unlikely(!bio))
> -		return -ENOMEM;
> +	if (unlikely(IS_ERR(bio)))
> +		return PTR_ERR(bio);
>  
>  	bio->bi_rw |= REQ_WRITE;
>  

Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
for current Kernel.

James: please apply to scsi-rc-fixes for the next round of fixes?

Thanks
Boaz

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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
  2010-11-14 13:39   ` Boaz Harrosh
@ 2010-11-21 10:31     ` Boaz Harrosh
  -1 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-21 10:31 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Dan Carpenter, Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/14/2010 03:39 PM, Boaz Harrosh wrote:
> On 11/12/2010 06:31 AM, Dan Carpenter wrote:
>> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>
> 
> Acked-by: Boaz Harrosh <bharrosh@panasas.com>
> 

James! Please submit this patch for scsi-rc-fixes. It is an important
fix for code that went into this merge window.

Thanks
Boaz

>> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
>> index 0433ea6..b798919 100644
>> --- a/drivers/scsi/osd/osd_initiator.c
>> +++ b/drivers/scsi/osd/osd_initiator.c
>> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>>  	/* create a bio for continuation segment */
>>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>>  			   GFP_KERNEL);
>> -	if (unlikely(!bio))
>> -		return -ENOMEM;
>> +	if (unlikely(IS_ERR(bio)))
>> +		return PTR_ERR(bio);
>>  
>>  	bio->bi_rw |= REQ_WRITE;
>>  
> 
> Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
> for current Kernel.
> 
> James: please apply to scsi-rc-fixes for the next round of fixes?
> 
> Thanks
> Boaz


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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
@ 2010-11-21 10:31     ` Boaz Harrosh
  0 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-21 10:31 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Dan Carpenter, Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/14/2010 03:39 PM, Boaz Harrosh wrote:
> On 11/12/2010 06:31 AM, Dan Carpenter wrote:
>> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>
> 
> Acked-by: Boaz Harrosh <bharrosh@panasas.com>
> 

James! Please submit this patch for scsi-rc-fixes. It is an important
fix for code that went into this merge window.

Thanks
Boaz

>> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
>> index 0433ea6..b798919 100644
>> --- a/drivers/scsi/osd/osd_initiator.c
>> +++ b/drivers/scsi/osd/osd_initiator.c
>> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>>  	/* create a bio for continuation segment */
>>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>>  			   GFP_KERNEL);
>> -	if (unlikely(!bio))
>> -		return -ENOMEM;
>> +	if (unlikely(IS_ERR(bio)))
>> +		return PTR_ERR(bio);
>>  
>>  	bio->bi_rw |= REQ_WRITE;
>>  
> 
> Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
> for current Kernel.
> 
> James: please apply to scsi-rc-fixes for the next round of fixes?
> 
> Thanks
> Boaz


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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
  2010-11-21 10:31     ` Boaz Harrosh
@ 2010-11-30 10:22       ` Boaz Harrosh
  -1 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-30 10:22 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Dan Carpenter, Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/21/2010 12:31 PM, Boaz Harrosh wrote:
> On 11/14/2010 03:39 PM, Boaz Harrosh wrote:
>> On 11/12/2010 06:31 AM, Dan Carpenter wrote:
>>> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
>>>
>>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>>
>>
>> Acked-by: Boaz Harrosh <bharrosh@panasas.com>
>>
> 
> James! Please submit this patch for scsi-rc-fixes. It is an important
> fix for code that went into this merge window.
> 
> Thanks
> Boaz
> 

James, ping?

>>> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
>>> index 0433ea6..b798919 100644
>>> --- a/drivers/scsi/osd/osd_initiator.c
>>> +++ b/drivers/scsi/osd/osd_initiator.c
>>> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>>>  	/* create a bio for continuation segment */
>>>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>>>  			   GFP_KERNEL);
>>> -	if (unlikely(!bio))
>>> -		return -ENOMEM;
>>> +	if (unlikely(IS_ERR(bio)))
>>> +		return PTR_ERR(bio);
>>>  
>>>  	bio->bi_rw |= REQ_WRITE;
>>>  
>>
>> Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
>> for current Kernel.
>>
>> James: please apply to scsi-rc-fixes for the next round of fixes?
>>
>> Thanks
>> Boaz
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: [patch] scsi/osd: checking NULL instead of ERR_PTR()
@ 2010-11-30 10:22       ` Boaz Harrosh
  0 siblings, 0 replies; 8+ messages in thread
From: Boaz Harrosh @ 2010-11-30 10:22 UTC (permalink / raw)
  To: James E.J. Bottomley
  Cc: Dan Carpenter, Benny Halevy, osd-dev, linux-scsi, kernel-janitors

On 11/21/2010 12:31 PM, Boaz Harrosh wrote:
> On 11/14/2010 03:39 PM, Boaz Harrosh wrote:
>> On 11/12/2010 06:31 AM, Dan Carpenter wrote:
>>> bio_map_kern() returns ERR_PTRs on failure and never returns NULL.
>>>
>>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>>
>>
>> Acked-by: Boaz Harrosh <bharrosh@panasas.com>
>>
> 
> James! Please submit this patch for scsi-rc-fixes. It is an important
> fix for code that went into this merge window.
> 
> Thanks
> Boaz
> 

James, ping?

>>> diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c
>>> index 0433ea6..b798919 100644
>>> --- a/drivers/scsi/osd/osd_initiator.c
>>> +++ b/drivers/scsi/osd/osd_initiator.c
>>> @@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key)
>>>  	/* create a bio for continuation segment */
>>>  	bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes,
>>>  			   GFP_KERNEL);
>>> -	if (unlikely(!bio))
>>> -		return -ENOMEM;
>>> +	if (unlikely(IS_ERR(bio)))
>>> +		return PTR_ERR(bio);
>>>  
>>>  	bio->bi_rw |= REQ_WRITE;
>>>  
>>
>> Wahoo, good catch, thanks! This is new code in 2.6.37-rc1. It should be pushed
>> for current Kernel.
>>
>> James: please apply to scsi-rc-fixes for the next round of fixes?
>>
>> Thanks
>> Boaz
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2010-11-30 10:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-12  4:31 [patch] scsi/osd: checking NULL instead of ERR_PTR() Dan Carpenter
2010-11-12  4:31 ` Dan Carpenter
2010-11-14 13:39 ` Boaz Harrosh
2010-11-14 13:39   ` Boaz Harrosh
2010-11-21 10:31   ` Boaz Harrosh
2010-11-21 10:31     ` Boaz Harrosh
2010-11-30 10:22     ` Boaz Harrosh
2010-11-30 10:22       ` Boaz Harrosh

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.