Skip to content

Commit b94e5e2

Browse files
Nian Jingakiernan
authored andcommitted
cvbs: clean up bad shift, deadcode, mixed enums errors
PD#150075: driver defect clean up: vdac_dev.c: #5 torvalds#6 torvalds#876 tv_vout.c: torvalds#181 torvalds#267 torvalds#311 torvalds#312 torvalds#313 torvalds#314 torvalds#315 torvalds#532 torvalds#605 Change-Id: I185072efb68df1abdad036a21867bb64efca914c Signed-off-by: Nian Jing <[email protected]>
1 parent 47b35c4 commit b94e5e2

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drivers/amlogic/media/vout/cvbs/cvbs_out.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,8 @@ static void cvbs_debug_store(char *buf)
843843
}
844844

845845
func_type_map(argv[1]);
846+
if (func_read == NULL)
847+
goto DEBUG_END;
846848
ret = kstrtoul(argv[2], 16, &addr);
847849

848850
print_info("read %s[0x%x] = 0x%x\n",
@@ -859,6 +861,8 @@ static void cvbs_debug_store(char *buf)
859861
}
860862

861863
func_type_map(argv[1]);
864+
if (func_read == NULL)
865+
goto DEBUG_END;
862866
ret = kstrtoul(argv[2], 16, &addr);
863867
ret = kstrtoul(argv[3], 10, &start);
864868
ret = kstrtoul(argv[4], 10, &length);
@@ -885,7 +889,8 @@ static void cvbs_debug_store(char *buf)
885889
}
886890

887891
func_type_map(argv[1]);
888-
892+
if (func_read == NULL)
893+
goto DEBUG_END;
889894
ret = kstrtoul(argv[2], 16, &start);
890895
ret = kstrtoul(argv[3], 16, &end);
891896

@@ -903,7 +908,8 @@ static void cvbs_debug_store(char *buf)
903908
}
904909

905910
func_type_map(argv[2]);
906-
911+
if (func_write == NULL)
912+
goto DEBUG_END;
907913
ret = kstrtoul(argv[1], 16, &value);
908914
ret = kstrtoul(argv[3], 16, &addr);
909915

@@ -921,7 +927,8 @@ static void cvbs_debug_store(char *buf)
921927
}
922928

923929
func_type_map(argv[2]);
924-
930+
if (func_read == NULL)
931+
goto DEBUG_END;
925932
ret = kstrtoul(argv[1], 16, &value);
926933
ret = kstrtoul(argv[3], 16, &addr);
927934
ret = kstrtoul(argv[4], 10, &start);

drivers/amlogic/media/vout/vdac/vdac_dev.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@ static int aml_vdac_probe(struct platform_device *pdev)
584584
cdev_del(&devp->cdev);
585585
fail_add_cdev:
586586
pr_err("%s: add device error\n", __func__);
587-
kfree(devp);
588587
fail_create_class:
589588
pr_err("%s: class create error\n", __func__);
590589
class_destroy(devp->clsp);
@@ -603,7 +602,6 @@ static int __exit aml_vdac_remove(struct platform_device *pdev)
603602
cdev_del(&devp->cdev);
604603
class_destroy(devp->clsp);
605604
unregister_chrdev_region(devp->devno, 1);
606-
kfree(devp);
607605
pr_info("%s: amvdac_exit.\n", __func__);
608606

609607
return 0;

0 commit comments

Comments
 (0)