Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'driver-core-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
"Here are two driver core fixes for 4.15-rc6, resolving some reported
issues.

The first is a cacheinfo fix for DT based systems to resolve a
reported issue that has been around for a while, and the other is to
resolve a regression in the kobject uevent code that showed up in
4.15-rc1.

Both have been in linux-next for a while with no reported issues"

* tag 'driver-core-4.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
kobject: fix suppressing modalias in uevents delivered over netlink
drivers: base: cacheinfo: fix cache type for non-architected system cache

+25 -4
+13
drivers/base/cacheinfo.c
··· 186 186 this_leaf->ways_of_associativity = (size / nr_sets) / line_size; 187 187 } 188 188 189 + static bool cache_node_is_unified(struct cacheinfo *this_leaf) 190 + { 191 + return of_property_read_bool(this_leaf->of_node, "cache-unified"); 192 + } 193 + 189 194 static void cache_of_override_properties(unsigned int cpu) 190 195 { 191 196 int index; ··· 199 194 200 195 for (index = 0; index < cache_leaves(cpu); index++) { 201 196 this_leaf = this_cpu_ci->info_list + index; 197 + /* 198 + * init_cache_level must setup the cache level correctly 199 + * overriding the architecturally specified levels, so 200 + * if type is NONE at this stage, it should be unified 201 + */ 202 + if (this_leaf->type == CACHE_TYPE_NOCACHE && 203 + cache_node_is_unified(this_leaf)) 204 + this_leaf->type = CACHE_TYPE_UNIFIED; 202 205 cache_size(this_leaf); 203 206 cache_get_line_size(this_leaf); 204 207 cache_nr_sets(this_leaf);
+12 -4
lib/kobject_uevent.c
··· 346 346 static void zap_modalias_env(struct kobj_uevent_env *env) 347 347 { 348 348 static const char modalias_prefix[] = "MODALIAS="; 349 - int i; 349 + size_t len; 350 + int i, j; 350 351 351 352 for (i = 0; i < env->envp_idx;) { 352 353 if (strncmp(env->envp[i], modalias_prefix, ··· 356 355 continue; 357 356 } 358 357 359 - if (i != env->envp_idx - 1) 360 - memmove(&env->envp[i], &env->envp[i + 1], 361 - sizeof(env->envp[i]) * env->envp_idx - 1); 358 + len = strlen(env->envp[i]) + 1; 359 + 360 + if (i != env->envp_idx - 1) { 361 + memmove(env->envp[i], env->envp[i + 1], 362 + env->buflen - len); 363 + 364 + for (j = i; j < env->envp_idx - 1; j++) 365 + env->envp[j] = env->envp[j + 1] - len; 366 + } 362 367 363 368 env->envp_idx--; 369 + env->buflen -= len; 364 370 } 365 371 } 366 372