Skip to content

Commit 37b8e1c

Browse files
elfringdavem330
authored andcommitted
irda: Delete an unnecessary check before the function call "irlmp_unregister_service"
The irlmp_unregister_service() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b3047a7 commit 37b8e1c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/irda/af_irda.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,8 +2123,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
21232123
}
21242124

21252125
/* Unregister any old registration */
2126-
if (self->skey)
2127-
irlmp_unregister_service(self->skey);
2126+
irlmp_unregister_service(self->skey);
21282127

21292128
self->skey = irlmp_register_service((__u16) opt);
21302129
break;

0 commit comments

Comments
 (0)