linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: qiuxu.zhuo@intel.com
Cc: linux-edac@vger.kernel.org
Subject: [bug report] EDAC/igen6: Add EDAC driver for Intel client SoCs using IBECC
Date: Tue, 25 Jan 2022 08:51:47 +0300	[thread overview]
Message-ID: <20220125055147.GA30689@kili> (raw)

Hello Qiuxu Zhuo,

The patch 10590a9d4f23: "EDAC/igen6: Add EDAC driver for Intel client
SoCs using IBECC" from Nov 5, 2020, leads to the following Smatch
static checker warning:

drivers/edac/igen6_edac.c:1275 igen6_init() warn: strncmp() with weird length: 10 vs 11
drivers/edac/i10nm_base.c:552 i10nm_init() warn: strncmp() with weird length: 10 vs 11
drivers/edac/sb_edac.c:3510 sbridge_init() warn: strncmp() with weird length: 7 vs 8
drivers/edac/skx_base.c:657 skx_init() warn: strncmp() with weird length: 8 vs 9
drivers/edac/pnd2_edac.c:1554 pnd2_init() warn: strncmp() with weird length: 9 vs 10
drivers/edac/amd64_edac.c:4266 amd64_edac_init() warn: strncmp() with weird length: 10 vs 11

drivers/edac/igen6_edac.c
    1265 };
    1266 
    1267 static int __init igen6_init(void)
    1268 {
    1269         const char *owner;
    1270         int rc;
    1271 
    1272         edac_dbg(2, "\n");
    1273 
    1274         owner = edac_get_owner();
--> 1275         if (owner && strncmp(owner, EDAC_MOD_STR, sizeof(EDAC_MOD_STR)))

Was strncmp() really intended?  Because this is 100% the equivalent to
strcmp() with no limit.  Maybe sizeof(EDAC_MOD_STR) - 1?

    1276                 return -ENODEV;
    1277 
    1278         edac_op_state = EDAC_OPSTATE_NMI;
    1279 
    1280         rc = pci_register_driver(&igen6_driver);
    1281         if (rc)
    1282                 return rc;
    1283 
    1284         igen6_printk(KERN_INFO, "%s\n", IGEN6_REVISION);
    1285 
    1286         return 0;
    1287 }

regards,
dan carpenter

                 reply	other threads:[~2022-01-25  5:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220125055147.GA30689@kili \
    --to=dan.carpenter@oracle.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=qiuxu.zhuo@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).