c
int
nvkm_firmware_ctor(const struct nvkm_firmware_func *func, const char *name,
                   struct nvkm_device *device, const void *src, int len, struct nvkm_firmware *fw)
{
    fw->func = func;
    fw->name = name;
    fw->device = device;
    fw->len = len;

    fw->img = kmemdup(src, fw->len, GFP_KERNEL);
    if (!fw->img) {
        // Handle error: memory allocation failed
        return -ENOMEM;
    }

    int aligned_len = ALIGN(fw->len, PAGE_SIZE);
    // Use aligned_len instead of reassigning len
    // ...
}
