Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you haven't received our response, please do the following:
check your Spam/Junk folder and click the "Not Spam" button for our message.
This way, you won't miss messages from our team in the future.

>
>
>
Examples of errors detected by the V102…

Examples of errors detected by the V1020 diagnostic

V1020. Function exited without performing epilogue actions. It is possible that there is an error.


Zephyr

V1020 The function exited without calling the 'k_mutex_unlock' function. Check lines: 620, 549. nvs.c 620


static int nvs_startup(struct nvs_fs *fs)
{
  ....
  k_mutex_lock(&fs->nvs_lock, K_FOREVER);
  ....
  if (fs->ate_wra == fs->data_wra && last_ate.len) {
    return -ESPIPE;
  }
  ....
end:
  k_mutex_unlock(&fs->nvs_lock);
  return rc;
}

Similar errors can be found in some other places:

  • V1020 The function exited without calling the 'k_mutex_unlock' function. Check lines: 574, 549. nvs.c 574
  • V1020 The function exited without calling the 'k_mutex_unlock' function. Check lines: 908, 890. net_context.c 908
  • V1020 The function exited without calling the 'k_mutex_unlock' function. Check lines: 1194, 1189. shell.c 1194

iSulad

V1020 [CWE-772] The function exited without calling the 'mutex_unlock' function. Check lines: 502, 495. local.c 502


struct volumes *local_volume_list(void)
{
    int ret = 0;
    map_itor *itor = NULL;
    struct volume *vol = NULL;
    struct volume *v = NULL;
    struct volumes *vols = NULL;
    size_t size = 0;

    mutex_lock(&g_volumes->mutex);

    size = map_size(g_volumes->vols_by_name);

    vols = new_empty_volumes(size);
    if (vols == NULL) {
        ERROR("out of memory");
        return NULL;
    }

    itor = map_itor_new(g_volumes->vols_by_name);
    if (itor == NULL) {
        ERROR("failed to get volumes's iterator to get all volumes");
        ret = -1;
        goto out;
    }
    ....
out:
    map_itor_free(itor);
    mutex_unlock(&g_volumes->mutex);

    if (ret != 0) {
        free_volumes(vols);
        vols = NULL;
    }

    return vols;
}