]> Git Repo - linux.git/blobdiff - drivers/fpga/xilinx-spi.c
brcmfmac: Fix out of bounds memory access during fw load
[linux.git] / drivers / fpga / xilinx-spi.c
index 8d19459665337d6234cce981f9bd949e0617a5e4..469486be20c423c0263c1934a1daca0bdb508415 100644 (file)
@@ -144,7 +144,6 @@ static int xilinx_spi_probe(struct spi_device *spi)
 {
        struct xilinx_spi_conf *conf;
        struct fpga_manager *mgr;
-       int ret;
 
        conf = devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL);
        if (!conf)
@@ -167,18 +166,15 @@ static int xilinx_spi_probe(struct spi_device *spi)
                return PTR_ERR(conf->done);
        }
 
-       mgr = fpga_mgr_create(&spi->dev, "Xilinx Slave Serial FPGA Manager",
-                             &xilinx_spi_ops, conf);
+       mgr = devm_fpga_mgr_create(&spi->dev,
+                                  "Xilinx Slave Serial FPGA Manager",
+                                  &xilinx_spi_ops, conf);
        if (!mgr)
                return -ENOMEM;
 
        spi_set_drvdata(spi, mgr);
 
-       ret = fpga_mgr_register(mgr);
-       if (ret)
-               fpga_mgr_free(mgr);
-
-       return ret;
+       return fpga_mgr_register(mgr);
 }
 
 static int xilinx_spi_remove(struct spi_device *spi)
This page took 0.033899 seconds and 4 git commands to generate.