libctf: Return CTF_ERR in ctf_type_resolve_unsliced PR 30836

Message ID 20231017185438.407796-1-torbjorn.svensson@foss.st.com
State Accepted
Headers
Series libctf: Return CTF_ERR in ctf_type_resolve_unsliced PR 30836 |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Torbjorn SVENSSON Oct. 17, 2023, 6:54 p.m. UTC
  There were one more place where the incorrect return value was used.

@Nick: Ok for trunk? :)

--

In commit 998a4f589d68503f79695f180fdf1742eeb0a39d, all but one return
statement was updated to return the error proper value. This commit
rectifies that missed return statement.

libctf/
	ctf-types.c (ctf_type_resolve_unsliced): Return CTF_ERR on error.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
---
 libctf/ctf-types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Nick Alcock Oct. 17, 2023, 7:40 p.m. UTC | #1
On 17 Oct 2023, Torbjörn SVENSSON uttered the following:

> There were one more place where the incorrect return value was used.
>
> @Nick: Ok for trunk? :)

By all means: push away. Dead obvious too, right above a correct one,
and I still overlooked it.

(I just checked for further instances of this in ctf-types.c and could
see none.)
  
Torbjorn SVENSSON Oct. 18, 2023, 7:40 a.m. UTC | #2
On 2023-10-17 21:40, Nick Alcock wrote:
> On 17 Oct 2023, Torbjörn SVENSSON uttered the following:
> 
>> There were one more place where the incorrect return value was used.
>>
>> @Nick: Ok for trunk? :)
> 
> By all means: push away. Dead obvious too, right above a correct one,
> and I still overlooked it.
> 
> (I just checked for further instances of this in ctf-types.c and could
> see none.)

Pushed.
  
Nick Alcock Oct. 20, 2023, 5:01 p.m. UTC | #3
On 18 Oct 2023, Torbjorn SVENSSON stated:

>
>
> On 2023-10-17 21:40, Nick Alcock wrote:
>> On 17 Oct 2023, Torbjörn SVENSSON uttered the following:
>> 
>>> There were one more place where the incorrect return value was used.
>>>
>>> @Nick: Ok for trunk? :)
>> By all means: push away. Dead obvious too, right above a correct one,
>> and I still overlooked it.
>> (I just checked for further instances of this in ctf-types.c and could
>> see none.)
>
> Pushed.

... as is the testcase.
  

Patch

diff --git a/libctf/ctf-types.c b/libctf/ctf-types.c
index 694d6ea79e4..4d3c01dbbb4 100644
--- a/libctf/ctf-types.c
+++ b/libctf/ctf-types.c
@@ -602,7 +602,7 @@  ctf_type_resolve_unsliced (ctf_dict_t *fp, ctf_id_t type)
   const ctf_type_t *tp;
 
   if ((type = ctf_type_resolve (fp, type)) == CTF_ERR)
-    return -1;
+    return CTF_ERR;
 
   if ((tp = ctf_lookup_by_id (&fp, type)) == NULL)
     return CTF_ERR;		/* errno is set for us.  */