lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <b39653f6-9587-4027-35ed-53d341845cb2@web.de>
Date:   Sun, 21 Jun 2020 14:45:10 +0200
From:   Markus Elfring <Markus.Elfring@....de>
To:     Tuomas Tynkkynen <tuomas.tynkkynen@....fi>,
        linux-media@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
        stable@...r.kernel.org,
        syzbot+6bed2d543cf7e48b822b@...kaller.appspotmail.com,
        Laurent Pinchart <laurent.pinchart@...asonboard.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>
Subject: Re: [PATCH] media: media-request: Fix crash according to a failed
 memory allocation

> …, reorder media_request_alloc() such that …

Wording adjustments:
…, reorder statements in the implementation of the function “media_request_alloc” so that …


> … the last step thus

… the last step.
Thus media_request_close() …


Would you like to add the tag “Fixes” to the commit message?


…
> +++ b/drivers/media/mc/mc-request.c
> @@ -296,9 +296,18 @@ int media_request_alloc(struct media_device *mdev, int *alloc_fd)
>  	if (WARN_ON(!mdev->ops->req_alloc ^ !mdev->ops->req_free))
>  		return -ENOMEM;
>
> +	if (mdev->ops->req_alloc)
> +		req = mdev->ops->req_alloc(mdev);
> +	else
> +		req = kzalloc(sizeof(*req), GFP_KERNEL);

How do you think about to use a conditional operator?

+	req = (mdev->ops->req_alloc
	       ? mdev->ops->req_alloc(mdev)
	       : kzalloc(sizeof(*req), GFP_KERNEL));


Regards,
Markus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ