Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scan-build: objects/pflash/libflash/libflash.c:571,2 Undefined or garbage value returned to caller #93

Closed
amboar opened this issue May 24, 2016 · 6 comments

Comments

@amboar
Copy link
Member

amboar commented May 24, 2016

546 int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
547 {
548     struct spi_flash_ctrl *ct = c->ctrl;
549     int rc;

1   'rc' declared without an initial value  →
550 
551     /*
552      * We only allow force 4b if both controller and flash do 4b
553      * as this is mainly used if a 3rd party tries to directly
554      * access a direct mapped read region
555      */
556     if (enable_4b && !((c->info.flags & FL_CAN_4B) && ct->set_4b))
557         return FLASH_ERR_4B_NOT_SUPPORTED;
558 
559     /* Only send to flash directly on controllers that implement
560      * the low level callbacks
561      */
562     if (ct->cmd_wr) {

2 ←   Taking false branch →
563         rc = flash_set_4b(c, enable_4b);
564         if (rc)
565             return rc;
566     }
567 
568     /* Then inform the controller */
569     if (ct->set_4b)

3 ←   Taking false branch →
570         rc = ct->set_4b(ct, enable_4b);
571     return rc;

4 ←   Undefined or garbage value returned to caller
572 }
@williamspatrick
Copy link
Member

This code should be deprecated per #19 .

@williamspatrick
Copy link
Member

@amboar - Has this been fixed in upstream pflash?

@amboar
Copy link
Member Author

amboar commented May 26, 2016

@williamspatrick I haven't checked, but I plan to

@amboar
Copy link
Member Author

amboar commented May 27, 2016

@williamspatrick looks to be fixed in skiboot/libflash:

int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
{
    struct spi_flash_ctrl *ct = c->ctrl;
    int rc = FLASH_ERR_4B_NOT_SUPPORTED;
    ...

@williamspatrick
Copy link
Member

Fixed.

@williamspatrick
Copy link
Member

(by removal of pflash)

JasonLuo701 pushed a commit to JasonLuo701/skeleton that referenced this issue May 19, 2017
…MC Health Sensor

bmchealth_handler.py: Add Watchdog Expired '0x3' for BMC Health Sensor

1. Check the file 'check_reboot' exist or not to judge last WDT reset is
   due to reboot or timeout.
2. The files 'watchdog1' and 'watchdog2' would record the event
   counters.
3. Compare the event counters between log files and register to judge
   logging event or not.
4. Update new event counters to log file

Change-Id: I58d58a195bba1adf3dbea7624ec2335fbc2cc452
Signed-off-by: Alex Wu <alex.jd.wu@mail.foxconn.com>

###This feature should combine with the branch 'G50/feature/93'

Related work items: openbmc#93
JasonLuo701 pushed a commit to JasonLuo701/skeleton that referenced this issue May 19, 2017
JasonLuo701 pushed a commit to JasonLuo701/skeleton that referenced this issue Jul 17, 2017
fix(feature 93): reset event count after log event

To clear event counter of WDT1 and WDT2 after log expired

Change-Id: I150a57d3739b0ca5082da9562e9b119ab8fc22b7
Signed-off-by: Alex Wu <alex.jd.wu@mail.foxconn.com>

Related work items: openbmc#93
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants