Commit 144601f
clk: vc5: check memory returned by kasprintf()
kasprintf() returns a pointer to dynamically allocated memory.
Pointer could be NULL in case allocation fails. Check pointer validity.
Identified with coccinelle (kmerr.cocci script).
Fixes: f491276 ("clk: vc5: Allow Versaclock driver to support multiple instances")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230530093913.1656095-2-claudiu.beznea@microchip.com
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>1 parent ac9a786 commit 144601f
1 file changed
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
1031 | 1036 | | |
1032 | 1037 | | |
1033 | 1038 | | |
| |||
1042 | 1047 | | |
1043 | 1048 | | |
1044 | 1049 | | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1045 | 1054 | | |
1046 | 1055 | | |
1047 | 1056 | | |
| |||
1057 | 1066 | | |
1058 | 1067 | | |
1059 | 1068 | | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
1060 | 1073 | | |
1061 | 1074 | | |
1062 | 1075 | | |
| |||
1074 | 1087 | | |
1075 | 1088 | | |
1076 | 1089 | | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
1077 | 1094 | | |
1078 | 1095 | | |
1079 | 1096 | | |
| |||
1093 | 1110 | | |
1094 | 1111 | | |
1095 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1096 | 1117 | | |
1097 | 1118 | | |
1098 | 1119 | | |
| |||
1111 | 1132 | | |
1112 | 1133 | | |
1113 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
1114 | 1139 | | |
1115 | 1140 | | |
1116 | 1141 | | |
| |||
1137 | 1162 | | |
1138 | 1163 | | |
1139 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1140 | 1169 | | |
1141 | 1170 | | |
1142 | 1171 | | |
| |||
0 commit comments