diff mbox series

Remove unused function parameter in __smc_diag_dump

Message ID 20241109-fix-oops-__smc_diag_dump-v1-1-1c55a3e54ad4@iiitd.ac.in (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Remove unused function parameter in __smc_diag_dump | expand

Checks

Context Check Description
netdev/series_format warning Single patches do not need cover letters; Target tree name not specified in the subject
netdev/tree_selection success Guessed tree name to be net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-09--18-00 (tests: 785)

Commit Message

Manas via B4 Relay Nov. 9, 2024, 6:28 a.m. UTC
From: Manas <manas18244@iiitd.ac.in>

The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
There is only one instance of this function being called and its passed
with a NULL value in place of bc.

Signed-off-by: Manas <manas18244@iiitd.ac.in>
---
The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
There is only one instance of this function being called and its passed
with a NULL value in place of bc.

Though, the compiler (gcc) optimizes it. Looking at the object dump of
vmlinux (via `objdump -D vmlinux`), a new function clone
(__smc_diag_dump.constprop.0) is added which removes this parameter from
calling convention altogether.

ffffffff8a701770 <__smc_diag_dump.constprop.0>:
ffffffff8a701770:       41 57                   push   %r15
ffffffff8a701772:       41 56                   push   %r14
ffffffff8a701774:       41 55                   push   %r13
ffffffff8a701776:       41 54                   push   %r12

There are 5 parameters in original function, but in the cloned function
only 4.

I believe this patch also fixes this oops bug[1], which arises in the
same function __smc_diag_dump. But I couldn't verify it further. Can
someone please test this?

[1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
---
 net/smc/smc_diag.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)


---
base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4

Best regards,

Comments

Jeongjun Park Nov. 11, 2024, 1:04 p.m. UTC | #1
Manas <devnull+manas18244.iiitd.ac.in@kernel.org> wrote:
> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
> There is only one instance of this function being called and its passed
> with a NULL value in place of bc.
> 
> Signed-off-by: Manas <manas18244@iiitd.ac.in>
> ---
> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
> There is only one instance of this function being called and its passed
> with a NULL value in place of bc.
> 
> Though, the compiler (gcc) optimizes it. Looking at the object dump of
> vmlinux (via `objdump -D vmlinux`), a new function clone
> (__smc_diag_dump.constprop.0) is added which removes this parameter from
> calling convention altogether.
> 
> ffffffff8a701770 <__smc_diag_dump.constprop.0>:
> ffffffff8a701770:       41 57                   push   %r15
> ffffffff8a701772:       41 56                   push   %r14
> ffffffff8a701774:       41 55                   push   %r13
> ffffffff8a701776:       41 54                   push   %r12
> 
> There are 5 parameters in original function, but in the cloned function
> only 4.
> 
> I believe this patch also fixes this oops bug[1], which arises in the
> same function __smc_diag_dump. But I couldn't verify it further. Can
> someone please test this?
> 
> [1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364

Unfortunately, I tested it myself and this bug is still triggering. Basically,
this bug is not triggered in normal situations, but triggered when a race
condition occurs, so I think the root cause is somewhere else.

Regards,

Jeongjun Park

> ---
>  net/smc/smc_diag.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
> index 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
> --- a/net/smc/smc_diag.c
> +++ b/net/smc/smc_diag.c
> @@ -71,8 +71,7 @@ static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
>  
>  static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
>  			   struct netlink_callback *cb,
> -			   const struct smc_diag_req *req,
> -			   struct nlattr *bc)
> +			   const struct smc_diag_req *req)
>  {
>  	struct smc_sock *smc = smc_sk(sk);
>  	struct smc_diag_fallback fallback;
> @@ -199,7 +198,6 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>  	struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
>  	struct net *net = sock_net(skb->sk);
>  	int snum = cb_ctx->pos[p_type];
> -	struct nlattr *bc = NULL;
>  	struct hlist_head *head;
>  	int rc = 0, num = 0;
>  	struct sock *sk;
> @@ -214,7 +212,7 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>  			continue;
>  		if (num < snum)
>  			goto next;
> -		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
> +		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
>  		if (rc < 0)
>  			goto out;
>  next:
> 
> ---
> base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
> change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4
> 
> Best regards,
> -- 
> Manas <manas18244@iiitd.ac.in>
Wenjia Zhang Nov. 11, 2024, 2:11 p.m. UTC | #2
On 09.11.24 07:28, Manas via B4 Relay wrote:
> From: Manas <manas18244@iiitd.ac.in>
> 
> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
> There is only one instance of this function being called and its passed
> with a NULL value in place of bc.
> 
> Signed-off-by: Manas <manas18244@iiitd.ac.in>
> ---
> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
> There is only one instance of this function being called and its passed
> with a NULL value in place of bc.
> 
> Though, the compiler (gcc) optimizes it. Looking at the object dump of
> vmlinux (via `objdump -D vmlinux`), a new function clone
> (__smc_diag_dump.constprop.0) is added which removes this parameter from
> calling convention altogether.
> 
> ffffffff8a701770 <__smc_diag_dump.constprop.0>:
> ffffffff8a701770:       41 57                   push   %r15
> ffffffff8a701772:       41 56                   push   %r14
> ffffffff8a701774:       41 55                   push   %r13
> ffffffff8a701776:       41 54                   push   %r12
> 
> There are 5 parameters in original function, but in the cloned function
> only 4.
> 
> I believe this patch also fixes this oops bug[1], which arises in the
> same function __smc_diag_dump. But I couldn't verify it further. Can
> someone please test this?
> 
> [1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
> ---
>   net/smc/smc_diag.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
> index 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
> --- a/net/smc/smc_diag.c
> +++ b/net/smc/smc_diag.c
> @@ -71,8 +71,7 @@ static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
>   
>   static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
>   			   struct netlink_callback *cb,
> -			   const struct smc_diag_req *req,
> -			   struct nlattr *bc)
> +			   const struct smc_diag_req *req)
>   {
>   	struct smc_sock *smc = smc_sk(sk);
>   	struct smc_diag_fallback fallback;
> @@ -199,7 +198,6 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>   	struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
>   	struct net *net = sock_net(skb->sk);
>   	int snum = cb_ctx->pos[p_type];
> -	struct nlattr *bc = NULL;
>   	struct hlist_head *head;
>   	int rc = 0, num = 0;
>   	struct sock *sk;
> @@ -214,7 +212,7 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>   			continue;
>   		if (num < snum)
>   			goto next;
> -		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
> +		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
>   		if (rc < 0)
>   			goto out;
>   next:
> 
> ---
> base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
> change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4
> 
> Best regards,

That's true that the last parameter is not used. And the patch you 
suggested as a cleanup patch looks good to me. However, it should not 
fix the bug[1], because it does not match what the bug[1] described. 
Thank you, Jeongjun, for testing it! That verified that it indeed didn't 
fix the issue. I think the root cause is on handling idiag_sport. I'll 
look into it.

[1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364

Thanks,
Wenjia
Manas Nov. 11, 2024, 3:06 p.m. UTC | #3
On 11.11.2024 22:04, Jeongjun Park wrote:
>Manas <devnull+manas18244.iiitd.ac.in@kernel.org> wrote:
>> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>> There is only one instance of this function being called and its passed
>> with a NULL value in place of bc.
>>
>> Signed-off-by: Manas <manas18244@iiitd.ac.in>
>> ---
>> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>> There is only one instance of this function being called and its passed
>> with a NULL value in place of bc.
>>
>> Though, the compiler (gcc) optimizes it. Looking at the object dump of
>> vmlinux (via `objdump -D vmlinux`), a new function clone
>> (__smc_diag_dump.constprop.0) is added which removes this parameter from
>> calling convention altogether.
>>
>> ffffffff8a701770 <__smc_diag_dump.constprop.0>:
>> ffffffff8a701770:       41 57                   push   %r15
>> ffffffff8a701772:       41 56                   push   %r14
>> ffffffff8a701774:       41 55                   push   %r13
>> ffffffff8a701776:       41 54                   push   %r12
>>
>> There are 5 parameters in original function, but in the cloned function
>> only 4.
>>
>> I believe this patch also fixes this oops bug[1], which arises in the
>> same function __smc_diag_dump. But I couldn't verify it further. Can
>> someone please test this?
>>
>> [1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
>
>Unfortunately, I tested it myself and this bug is still triggering. Basically,
>this bug is not triggered in normal situations, but triggered when a race
>condition occurs, so I think the root cause is somewhere else.
>
Thank you Jeongjun for reviewing this.

>> ---
>>  net/smc/smc_diag.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
>> index 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
>> --- a/net/smc/smc_diag.c
>> +++ b/net/smc/smc_diag.c
>> @@ -71,8 +71,7 @@ static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
>>
>>  static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
>>  			   struct netlink_callback *cb,
>> -			   const struct smc_diag_req *req,
>> -			   struct nlattr *bc)
>> +			   const struct smc_diag_req *req)
>>  {
>>  	struct smc_sock *smc = smc_sk(sk);
>>  	struct smc_diag_fallback fallback;
>> @@ -199,7 +198,6 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>>  	struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
>>  	struct net *net = sock_net(skb->sk);
>>  	int snum = cb_ctx->pos[p_type];
>> -	struct nlattr *bc = NULL;
>>  	struct hlist_head *head;
>>  	int rc = 0, num = 0;
>>  	struct sock *sk;
>> @@ -214,7 +212,7 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>>  			continue;
>>  		if (num < snum)
>>  			goto next;
>> -		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
>> +		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
>>  		if (rc < 0)
>>  			goto out;
>>  next:
>>
>> ---
>> base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
>> change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4
>>
>> Best regards,
>> --
>> Manas <manas18244@iiitd.ac.in>
Manas Nov. 11, 2024, 3:10 p.m. UTC | #4
On 11.11.2024 15:11, Wenjia Zhang wrote:
>
>
>On 09.11.24 07:28, Manas via B4 Relay wrote:
>>From: Manas <manas18244@iiitd.ac.in>
>>
>>The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>>There is only one instance of this function being called and its passed
>>with a NULL value in place of bc.
>>
>>Signed-off-by: Manas <manas18244@iiitd.ac.in>
>>---
>>The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>>There is only one instance of this function being called and its passed
>>with a NULL value in place of bc.
>>
>>Though, the compiler (gcc) optimizes it. Looking at the object dump of
>>vmlinux (via `objdump -D vmlinux`), a new function clone
>>(__smc_diag_dump.constprop.0) is added which removes this parameter from
>>calling convention altogether.
>>
>>ffffffff8a701770 <__smc_diag_dump.constprop.0>:
>>ffffffff8a701770:       41 57                   push   %r15
>>ffffffff8a701772:       41 56                   push   %r14
>>ffffffff8a701774:       41 55                   push   %r13
>>ffffffff8a701776:       41 54                   push   %r12
>>
>>There are 5 parameters in original function, but in the cloned function
>>only 4.
>>
>>I believe this patch also fixes this oops bug[1], which arises in the
>>same function __smc_diag_dump. But I couldn't verify it further. Can
>>someone please test this?
>>
>>[1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
>>---
>>  net/smc/smc_diag.c | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>>diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
>>index 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
>>--- a/net/smc/smc_diag.c
>>+++ b/net/smc/smc_diag.c
>>@@ -71,8 +71,7 @@ static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
>>  static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
>>  			   struct netlink_callback *cb,
>>-			   const struct smc_diag_req *req,
>>-			   struct nlattr *bc)
>>+			   const struct smc_diag_req *req)
>>  {
>>  	struct smc_sock *smc = smc_sk(sk);
>>  	struct smc_diag_fallback fallback;
>>@@ -199,7 +198,6 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>>  	struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
>>  	struct net *net = sock_net(skb->sk);
>>  	int snum = cb_ctx->pos[p_type];
>>-	struct nlattr *bc = NULL;
>>  	struct hlist_head *head;
>>  	int rc = 0, num = 0;
>>  	struct sock *sk;
>>@@ -214,7 +212,7 @@ static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
>>  			continue;
>>  		if (num < snum)
>>  			goto next;
>>-		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
>>+		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
>>  		if (rc < 0)
>>  			goto out;
>>  next:
>>
>>---
>>base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
>>change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4
>>
>>Best regards,
>
>That's true that the last parameter is not used. And the patch you 
>suggested as a cleanup patch looks good to me. However, it should not 
>fix the bug[1], because it does not match what the bug[1] described. 
>Thank you, Jeongjun, for testing it! That verified that it indeed 
>didn't fix the issue. I think the root cause is on handling 
>idiag_sport. I'll look into it.
>
>[1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
>
>Thanks,
>Wenjia

Thank you Wenjia for reviewing this.

Should I make any changes to the commit message if we are going forward with it
being as a cleanup patch? The commit message itself (barring the cover letter)
should be enough, I reckon.
Wenjia Zhang Nov. 12, 2024, 7:36 a.m. UTC | #5
On 11.11.24 16:10, Manas wrote:
> On 11.11.2024 15:11, Wenjia Zhang wrote:
>>
>>
>> On 09.11.24 07:28, Manas via B4 Relay wrote:
>>> From: Manas <manas18244@iiitd.ac.in>
>>>
>>> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>>> There is only one instance of this function being called and its passed
>>> with a NULL value in place of bc.
>>>
>>> Signed-off-by: Manas <manas18244@iiitd.ac.in>
>>> ---
>>> The last parameter in __smc_diag_dump (struct nlattr *bc) is unused.
>>> There is only one instance of this function being called and its passed
>>> with a NULL value in place of bc.
>>>
>>> Though, the compiler (gcc) optimizes it. Looking at the object dump of
>>> vmlinux (via `objdump -D vmlinux`), a new function clone
>>> (__smc_diag_dump.constprop.0) is added which removes this parameter from
>>> calling convention altogether.
>>>
>>> ffffffff8a701770 <__smc_diag_dump.constprop.0>:
>>> ffffffff8a701770:       41 57                   push   %r15
>>> ffffffff8a701772:       41 56                   push   %r14
>>> ffffffff8a701774:       41 55                   push   %r13
>>> ffffffff8a701776:       41 54                   push   %r12
>>>
>>> There are 5 parameters in original function, but in the cloned function
>>> only 4.
>>>
>>> I believe this patch also fixes this oops bug[1], which arises in the
>>> same function __smc_diag_dump. But I couldn't verify it further. Can
>>> someone please test this?
>>>
>>> [1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
>>> ---
>>>  net/smc/smc_diag.c | 6 ++----
>>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
>>> index 
>>> 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
>>> --- a/net/smc/smc_diag.c
>>> +++ b/net/smc/smc_diag.c
>>> @@ -71,8 +71,7 @@ static int smc_diag_msg_attrs_fill(struct sock *sk, 
>>> struct sk_buff *skb,
>>>  static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
>>>                 struct netlink_callback *cb,
>>> -               const struct smc_diag_req *req,
>>> -               struct nlattr *bc)
>>> +               const struct smc_diag_req *req)
>>>  {
>>>      struct smc_sock *smc = smc_sk(sk);
>>>      struct smc_diag_fallback fallback;
>>> @@ -199,7 +198,6 @@ static int smc_diag_dump_proto(struct proto 
>>> *prot, struct sk_buff *skb,
>>>      struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
>>>      struct net *net = sock_net(skb->sk);
>>>      int snum = cb_ctx->pos[p_type];
>>> -    struct nlattr *bc = NULL;
>>>      struct hlist_head *head;
>>>      int rc = 0, num = 0;
>>>      struct sock *sk;
>>> @@ -214,7 +212,7 @@ static int smc_diag_dump_proto(struct proto 
>>> *prot, struct sk_buff *skb,
>>>              continue;
>>>          if (num < snum)
>>>              goto next;
>>> -        rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
>>> +        rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
>>>          if (rc < 0)
>>>              goto out;
>>>  next:
>>>
>>> ---
>>> base-commit: 59b723cd2adbac2a34fc8e12c74ae26ae45bf230
>>> change-id: 20241109-fix-oops-__smc_diag_dump-06ab3e9d39f4
>>>
>>> Best regards,
>>
>> That's true that the last parameter is not used. And the patch you 
>> suggested as a cleanup patch looks good to me. However, it should not 
>> fix the bug[1], because it does not match what the bug[1] described. 
>> Thank you, Jeongjun, for testing it! That verified that it indeed 
>> didn't fix the issue. I think the root cause is on handling 
>> idiag_sport. I'll look into it.
>>
>> [1] https://syzkaller.appspot.com/bug?extid=271fed3ed6f24600c364
>>
>> Thanks,
>> Wenjia
> 
> Thank you Wenjia for reviewing this.
> 
> Should I make any changes to the commit message if we are going forward 
> with it
> being as a cleanup patch? The commit message itself (barring the cover 
> letter)
> should be enough, I reckon.
> 
I think it is ok as it is.

Thanks,
Wenjia
Simon Horman Nov. 12, 2024, 6:22 p.m. UTC | #6
On Tue, Nov 12, 2024 at 08:36:13AM +0100, Wenjia Zhang wrote:
> 
> 
> On 11.11.24 16:10, Manas wrote:
> > On 11.11.2024 15:11, Wenjia Zhang wrote:

...

> > Thank you Wenjia for reviewing this.
> > 
> > Should I make any changes to the commit message if we are going forward
> > with it
> > being as a cleanup patch? The commit message itself (barring the cover
> > letter)
> > should be enough, I reckon.
> > 
> I think it is ok as it is.

Yes, agreed.

The commit message should be truncated at first scissors ("---").
Which leaves us with a commit message only describing the removal
of an unused function parameter. Which, given the discussion in
this thread, is what we want.

Reviewed-by: Simon Horman <horms@kernel.org>

> 
> Thanks,
> Wenjia
>
diff mbox series

Patch

diff --git a/net/smc/smc_diag.c b/net/smc/smc_diag.c
index 6fdb2d96777ad704c394709ec845f9ddef5e599a..8f7bd40f475945171a0afa5a2cce12d9aa2b1eb4 100644
--- a/net/smc/smc_diag.c
+++ b/net/smc/smc_diag.c
@@ -71,8 +71,7 @@  static int smc_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
 
 static int __smc_diag_dump(struct sock *sk, struct sk_buff *skb,
 			   struct netlink_callback *cb,
-			   const struct smc_diag_req *req,
-			   struct nlattr *bc)
+			   const struct smc_diag_req *req)
 {
 	struct smc_sock *smc = smc_sk(sk);
 	struct smc_diag_fallback fallback;
@@ -199,7 +198,6 @@  static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
 	struct smc_diag_dump_ctx *cb_ctx = smc_dump_context(cb);
 	struct net *net = sock_net(skb->sk);
 	int snum = cb_ctx->pos[p_type];
-	struct nlattr *bc = NULL;
 	struct hlist_head *head;
 	int rc = 0, num = 0;
 	struct sock *sk;
@@ -214,7 +212,7 @@  static int smc_diag_dump_proto(struct proto *prot, struct sk_buff *skb,
 			continue;
 		if (num < snum)
 			goto next;
-		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh), bc);
+		rc = __smc_diag_dump(sk, skb, cb, nlmsg_data(cb->nlh));
 		if (rc < 0)
 			goto out;
 next: