public inbox for kernel-janitors@vger.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; 15+ 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] 15+ messages in thread

end of thread, other threads:[~2017-08-25 11:41 UTC | newest]

Thread overview: 15+ 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:47     ` Borislav Petkov
2017-08-24 20:55       ` Dan Carpenter
2017-08-24 20:58         ` Borislav Petkov
2017-08-24 21:08           ` Dan Carpenter
2017-08-24 21:12             ` Borislav Petkov
2017-08-25  9:06               ` Borislav Petkov
2017-08-25  9:12                 ` Dan Carpenter
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:40                       ` walter harms
2017-08-25 11:41                         ` Borislav Petkov
2017-08-24 21:02       ` [PATCH v2] x86/microcode: Silence a static checker warning Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox