hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/clk/clk-versaclock5.c
....@@ -906,6 +906,11 @@
906906 }
907907
908908 init.name = kasprintf(GFP_KERNEL, "%pOFn.mux", client->dev.of_node);
909
+ if (!init.name) {
910
+ ret = -ENOMEM;
911
+ goto err_clk;
912
+ }
913
+
909914 init.ops = &vc5_mux_ops;
910915 init.flags = 0;
911916 init.parent_names = parent_names;
....@@ -920,6 +925,10 @@
920925 memset(&init, 0, sizeof(init));
921926 init.name = kasprintf(GFP_KERNEL, "%pOFn.dbl",
922927 client->dev.of_node);
928
+ if (!init.name) {
929
+ ret = -ENOMEM;
930
+ goto err_clk;
931
+ }
923932 init.ops = &vc5_dbl_ops;
924933 init.flags = CLK_SET_RATE_PARENT;
925934 init.parent_names = parent_names;
....@@ -935,6 +944,10 @@
935944 /* Register PFD */
936945 memset(&init, 0, sizeof(init));
937946 init.name = kasprintf(GFP_KERNEL, "%pOFn.pfd", client->dev.of_node);
947
+ if (!init.name) {
948
+ ret = -ENOMEM;
949
+ goto err_clk;
950
+ }
938951 init.ops = &vc5_pfd_ops;
939952 init.flags = CLK_SET_RATE_PARENT;
940953 init.parent_names = parent_names;
....@@ -952,6 +965,10 @@
952965 /* Register PLL */
953966 memset(&init, 0, sizeof(init));
954967 init.name = kasprintf(GFP_KERNEL, "%pOFn.pll", client->dev.of_node);
968
+ if (!init.name) {
969
+ ret = -ENOMEM;
970
+ goto err_clk;
971
+ }
955972 init.ops = &vc5_pll_ops;
956973 init.flags = CLK_SET_RATE_PARENT;
957974 init.parent_names = parent_names;
....@@ -971,6 +988,10 @@
971988 memset(&init, 0, sizeof(init));
972989 init.name = kasprintf(GFP_KERNEL, "%pOFn.fod%d",
973990 client->dev.of_node, idx);
991
+ if (!init.name) {
992
+ ret = -ENOMEM;
993
+ goto err_clk;
994
+ }
974995 init.ops = &vc5_fod_ops;
975996 init.flags = CLK_SET_RATE_PARENT;
976997 init.parent_names = parent_names;
....@@ -989,6 +1010,10 @@
9891010 memset(&init, 0, sizeof(init));
9901011 init.name = kasprintf(GFP_KERNEL, "%pOFn.out0_sel_i2cb",
9911012 client->dev.of_node);
1013
+ if (!init.name) {
1014
+ ret = -ENOMEM;
1015
+ goto err_clk;
1016
+ }
9921017 init.ops = &vc5_clk_out_ops;
9931018 init.flags = CLK_SET_RATE_PARENT;
9941019 init.parent_names = parent_names;
....@@ -1015,6 +1040,10 @@
10151040 memset(&init, 0, sizeof(init));
10161041 init.name = kasprintf(GFP_KERNEL, "%pOFn.out%d",
10171042 client->dev.of_node, idx + 1);
1043
+ if (!init.name) {
1044
+ ret = -ENOMEM;
1045
+ goto err_clk;
1046
+ }
10181047 init.ops = &vc5_clk_out_ops;
10191048 init.flags = CLK_SET_RATE_PARENT;
10201049 init.parent_names = parent_names;