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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YGLt5R1AlgGrPtv4@kroah.com>
Date:   Tue, 30 Mar 2021 11:22:45 +0200
From:   Greg KH <greg@...ah.com>
To:     sj38.park@...il.com
Cc:     akpm@...ux-foundation.org, SeongJae Park <sjpark@...zon.de>,
        Jonathan.Cameron@...wei.com, acme@...nel.org,
        alexander.shishkin@...ux.intel.com, amit@...nel.org,
        benh@...nel.crashing.org, brendanhiggins@...gle.com,
        corbet@....net, david@...hat.com, dwmw@...zon.com,
        elver@...gle.com, fan.du@...el.com, foersleo@...zon.de,
        gthelen@...gle.com, guoju.fgj@...baba-inc.com, mgorman@...e.de,
        minchan@...nel.org, mingo@...hat.com, namhyung@...nel.org,
        peterz@...radead.org, riel@...riel.com, rientjes@...gle.com,
        rostedt@...dmis.org, rppt@...nel.org, shakeelb@...gle.com,
        shuah@...nel.org, snu@...zon.de, vbabka@...e.cz,
        vdavydov.dev@...il.com, zgf574564920@...il.com,
        linux-damon@...zon.com, linux-mm@...ck.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v26 07/13] mm/damon: Implement a debugfs-based user space
 interface

On Tue, Mar 30, 2021 at 09:05:31AM +0000, sj38.park@...il.com wrote:
> +static int __init __damon_dbgfs_init(void)
> +{
> +	struct dentry *dbgfs_root;
> +	const char * const file_names[] = {"monitor_on"};
> +	const struct file_operations *fops[] = {&monitor_on_fops};
> +	int i;
> +
> +	dbgfs_root = debugfs_create_dir("damon", NULL);
> +
> +	for (i = 0; i < ARRAY_SIZE(file_names); i++)
> +		debugfs_create_file(file_names[i], 0600, dbgfs_root, NULL,
> +				fops[i]);
> +	dbgfs_fill_ctx_dir(dbgfs_root, dbgfs_ctxs[0]);
> +
> +	dbgfs_dirs = kmalloc_array(1, sizeof(dbgfs_root), GFP_KERNEL);

No error checking for memory allocation failures?


> +	dbgfs_dirs[0] = dbgfs_root;
> +
> +	return 0;
> +}
> +
> +/*
> + * Functions for the initialization
> + */
> +
> +static int __init damon_dbgfs_init(void)
> +{
> +	int rc;
> +
> +	dbgfs_ctxs = kmalloc(sizeof(*dbgfs_ctxs), GFP_KERNEL);

No error checking?

> +	dbgfs_ctxs[0] = dbgfs_new_ctx();
> +	if (!dbgfs_ctxs[0])
> +		return -ENOMEM;
> +	dbgfs_nr_ctxs = 1;
> +
> +	rc = __damon_dbgfs_init();
> +	if (rc)
> +		pr_err("%s: dbgfs init failed\n", __func__);

Shouldn't the error be printed out in the function that failed, not in
this one?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ