return NEW_UCODE;
}
-static void free_patch(struct microcode_patch *patch)
-{
- xfree(patch);
-}
-
static enum microcode_match_result compare_header(
const struct microcode_patch *new, const struct microcode_patch *old)
{
.start_update = start_update,
.end_update_percpu = svm_host_osvw_init,
#endif
- .free_patch = free_patch,
.compare_patch = compare_patch,
};
return NULL;
}
-static void microcode_free_patch(struct microcode_patch *microcode_patch)
+static void microcode_free_patch(struct microcode_patch *patch)
{
- microcode_ops->free_patch(microcode_patch);
+ xfree(patch);
}
/* Return true if cache gets updated. Otherwise, return false */
return mc->rev > cpu_sig->rev ? NEW_UCODE : OLD_UCODE;
}
-static void free_patch(struct microcode_patch *patch)
-{
- xfree(patch);
-}
-
static enum microcode_match_result compare_patch(
const struct microcode_patch *new, const struct microcode_patch *old)
{
.cpu_request_microcode = cpu_request_microcode,
.collect_cpu_info = collect_cpu_info,
.apply_microcode = apply_microcode,
- .free_patch = free_patch,
.compare_patch = compare_patch,
};
*
* If one is found, allocate and return a struct microcode_patch
* encapsulating the appropriate microcode patch. Does not alias the
- * original buffer.
+ * original buffer. Must be suitable to be freed with a single xfree().
*
* If one is not found, (nothing matches the current CPU), return NULL.
* Also may return ERR_PTR(-err), e.g. bad container, out of memory.
*/
void (*end_update_percpu)(void);
- /* Free a patch previously allocated by cpu_request_microcode(). */
- void (*free_patch)(struct microcode_patch *patch);
-
/*
* Given two patches, are they both applicable to the current CPU, and is
* new a higher revision than old?