All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/microcode/intel: Silence a static checker warning
@ 2017-08-22 20:44 Dan Carpenter
  2017-08-22 21:13 ` Borislav Petkov
  0 siblings, 1 reply; 29+ messages in thread
From: Dan Carpenter @ 2017-08-22 20:44 UTC (permalink / raw)
  To: kernel-janitors

Smatch complains that we could dereference a "p" when it's an error
pointer.  It's seems unlikely, but it's easy enough to make the checker
happy.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/arch/x86/kernel/cpu/microcode/intel.c b/arch/x86/kernel/cpu/microcode/intel.c
index 59edbe9d4ccb..c9c46a138e0e 100644
--- a/arch/x86/kernel/cpu/microcode/intel.c
+++ b/arch/x86/kernel/cpu/microcode/intel.c
@@ -208,7 +208,7 @@ static void save_microcode_patch(void *data, unsigned int size)
 	 * address as the APs are running from physical addresses, before
 	 * paging has been enabled.
 	 */
-	if (p) {
+	if (!IS_ERR_OR_NULL(p)) {
 		if (IS_ENABLED(CONFIG_X86_32))
 			intel_ucode_patch = (struct microcode_intel *)__pa_nodebug(p->data);
 		else

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2017-08-29  9:06 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-22 20:44 [PATCH] x86/microcode/intel: Silence a static checker warning Dan Carpenter
2017-08-22 21:13 ` Borislav Petkov
2017-08-24 20:15   ` [PATCH v2] x86/microcode: " Dan Carpenter
2017-08-24 20:15     ` Dan Carpenter
2017-08-24 20:47     ` Borislav Petkov
2017-08-24 20:47       ` Borislav Petkov
2017-08-24 20:55       ` Dan Carpenter
2017-08-24 20:55         ` Dan Carpenter
2017-08-24 20:58         ` Borislav Petkov
2017-08-24 20:58           ` Borislav Petkov
2017-08-24 21:08           ` Dan Carpenter
2017-08-24 21:08             ` Dan Carpenter
2017-08-24 21:12             ` Borislav Petkov
2017-08-24 21:12               ` Borislav Petkov
2017-08-25  9:06               ` Borislav Petkov
2017-08-25  9:06                 ` Borislav Petkov
2017-08-25  9:12                 ` Dan Carpenter
2017-08-25  9:12                   ` Dan Carpenter
2017-08-25  9:14                   ` Borislav Petkov
2017-08-25  9:14                     ` Borislav Petkov
2017-08-25 10:04                     ` [PATCH] x86/microcode/intel: Improve microcode patches saving flow Borislav Petkov
2017-08-25 10:04                       ` Borislav Petkov
2017-08-25 10:40                       ` walter harms
2017-08-25 10:40                         ` walter harms
2017-08-25 11:41                         ` Borislav Petkov
2017-08-25 11:41                           ` Borislav Petkov
2017-08-29  9:03                       ` [tip:x86/microcode] " tip-bot for Borislav Petkov
2017-08-24 21:02       ` [PATCH v2] x86/microcode: Silence a static checker warning Joe Perches
2017-08-24 21:02         ` Joe Perches

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.