Skip to content

Commit de226ec

Browse files
Alphixmchehab
authored andcommitted
[media] media: lirc_dev: clarify error handling
If an error is generated, it is more logical to error out ASAP. Signed-off-by: David Härdeman <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent cf09e3c commit de226ec

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/media/rc/lirc_dev.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ EXPORT_SYMBOL(lirc_unregister_driver);
286286
int lirc_dev_fop_open(struct inode *inode, struct file *file)
287287
{
288288
struct irctl *ir;
289-
int retval = 0;
289+
int retval;
290290

291291
if (iminor(inode) >= MAX_IRCTL_DEVICES) {
292292
pr_err("open result for %d is -ENODEV\n", iminor(inode));
@@ -327,9 +327,11 @@ int lirc_dev_fop_open(struct inode *inode, struct file *file)
327327

328328
ir->open++;
329329

330-
error:
331330
nonseekable_open(inode, file);
332331

332+
return 0;
333+
334+
error:
333335
return retval;
334336
}
335337
EXPORT_SYMBOL(lirc_dev_fop_open);

0 commit comments

Comments
 (0)